mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-31 15:00:52 +00:00
增加附件图片搜索
This commit is contained in:
parent
637aade62a
commit
a4ac1b426a
@ -43,7 +43,8 @@ class SystemAttachment extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['pid', 0]
|
||||
['pid', 0],
|
||||
['real_name', '']
|
||||
]);
|
||||
return app('json')->success($this->service->getImageList($where));
|
||||
}
|
||||
|
||||
@ -63,6 +63,16 @@ class SystemAttachment extends BaseModel
|
||||
*/
|
||||
public function searchLikeNameAttr($query, $value)
|
||||
{
|
||||
if ($value) $query->where('name','LIKE' ,"$value%");
|
||||
if ($value) $query->where('name', 'LIKE', "$value%");
|
||||
}
|
||||
|
||||
/**
|
||||
* real_name模糊搜索
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchRealNameAttr($query, $value)
|
||||
{
|
||||
if ($value != '') $query->where('real_name', 'LIKE', "%$value%");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user