mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 05:50:50 +00:00
优化物流公司
This commit is contained in:
parent
73da9941cc
commit
ebd33098f0
@ -43,7 +43,8 @@ class Express extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['keyword', '']
|
||||
['keyword', ''],
|
||||
['is_show', '']
|
||||
]);
|
||||
return app('json')->success($this->services->getExpressList($where));
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class ExpressDao extends BaseDao
|
||||
*/
|
||||
public function getExpressList(array $where, string $field, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->field($field)->order('sort DESC,id DESC')
|
||||
return $this->search($where)->field($field)->order('sort DESC,is_show DESC')
|
||||
->when($page > 0 && $limit > 0, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->select()->toArray();
|
||||
|
||||
@ -41,11 +41,10 @@ class Express extends BaseModel
|
||||
* 物流公司是否显示
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchIsShowAttr($query, $value, $data)
|
||||
public function searchIsShowAttr($query, $value)
|
||||
{
|
||||
$query->where('is_show', $value);
|
||||
if ($value !== '') $query->where('is_show', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user