开发者搜索

This commit is contained in:
JaguarJack
2020-09-03 19:07:19 +08:00
parent 2941eeac1e
commit 8f73948223
3 changed files with 40 additions and 8 deletions

View File

@@ -11,10 +11,13 @@
namespace catchAdmin\system\model;
use catchAdmin\system\model\search\DeveloperSearch;
use catcher\base\CatchModel as Model;
class Developers extends Model
{
use DeveloperSearch;
protected $name = 'developers';
protected $field = [

View File

@@ -0,0 +1,29 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\system\model\search;
trait DeveloperSearch
{
public function searchUsernameAttr($query, $value, $data)
{
return $query->whereLike('username', $value);
}
public function searchMobileAttr($query, $value, $data)
{
return $query->whereLike('mobile', $value);
}
public function searchStatusAttr($query, $value, $data)
{
return $query->where('driver', $value);
}
}