diff --git a/crmeb/app/adminapi/controller/v1/freight/Express.php b/crmeb/app/adminapi/controller/v1/freight/Express.php index 39bed32e8..6836476e2 100644 --- a/crmeb/app/adminapi/controller/v1/freight/Express.php +++ b/crmeb/app/adminapi/controller/v1/freight/Express.php @@ -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)); } diff --git a/crmeb/app/dao/shipping/ExpressDao.php b/crmeb/app/dao/shipping/ExpressDao.php index 0c9c1c9e1..419e1ac98 100644 --- a/crmeb/app/dao/shipping/ExpressDao.php +++ b/crmeb/app/dao/shipping/ExpressDao.php @@ -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(); diff --git a/crmeb/app/model/other/Express.php b/crmeb/app/model/other/Express.php index 8e6b19aa2..901401d04 100644 --- a/crmeb/app/model/other/Express.php +++ b/crmeb/app/model/other/Express.php @@ -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); } /**