From b7062fc425602ae11dddd2c762c8b71dc519af1d Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Sun, 4 Feb 2024 11:42:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=88=86=E5=89=B2=E4=B8=BA=E5=95=86=E6=88=B7=E3=80=81=E9=85=92?= =?UTF-8?q?=E9=81=93=E9=A6=86=E3=80=81=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/system/merchant/MerchantDao.php | 4 ++++ .../admin/system/merchant/Merchant.php | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index c94a238..4b0db25 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -37,7 +37,11 @@ class MerchantDao extends BaseDao */ public function search(array $where, $is_del = 0) { + $merchantType = $where['merchant_type'] ?? 0; + $merchantType = in_array((int)$merchantType,[1,2,3]) ? $merchantType : 0;// 类型非法,使用默认类型 + $query = Merchant::getDB() + ->where('merchant_type', $merchantType) ->when($is_del !== null, function ($query) use ($is_del) { $query->where('is_del', $is_del); }) diff --git a/app/controller/admin/system/merchant/Merchant.php b/app/controller/admin/system/merchant/Merchant.php index 3c1aefe..69db61a 100644 --- a/app/controller/admin/system/merchant/Merchant.php +++ b/app/controller/admin/system/merchant/Merchant.php @@ -50,7 +50,7 @@ class Merchant extends BaseController public function count() { - $where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']); + $where = $this->request->params(['keyword','date','status','statusTag','is_trader','category_id','type_id','merchant_type']); return app('json')->success($this->repository->count($where)); } @@ -65,7 +65,20 @@ class Merchant extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $where = $this->request->params(['mer_id_list','keyword','mer_id', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id',['order','create_time'],'is_best']); + $where = $this->request->params([ + 'mer_id_list', + 'keyword', + 'mer_id', + 'date', + 'status', + 'statusTag', + 'is_trader', + 'category_id', + 'type_id', + ['order','create_time'], + 'is_best', + 'merchant_type' + ]); return app('json')->success($this->repository->lst($where, $page, $limit)); } @@ -208,6 +221,7 @@ class Merchant extends BaseController ['mer_exchange_quota_multiple',0], ['avg_consumption',0], 'mer_label', + ['merchant_type',0], ]); $data['mer_label'] = str_replace(',',',',$data['mer_label']); if (!$isUpdate) {