From ebd33098f0614ccfe597c1801f7c941c4d7a5d5c Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 28 Jun 2023 17:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=A9=E6=B5=81=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/freight/Express.php | 3 ++- crmeb/app/dao/shipping/ExpressDao.php | 2 +- crmeb/app/model/other/Express.php | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) 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); } /**