From 34d3408944d25d34032339eb29fab3d89a667894 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 5 Jun 2023 15:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=94=A8=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E6=9C=8D=E5=8A=A1=E5=9B=A2=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantTypeRepository.php | 8 ++++++-- app/controller/api/store/merchant/MerchantIntention.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantTypeRepository.php b/app/common/repositories/system/merchant/MerchantTypeRepository.php index 87595f78..e99f97d7 100644 --- a/app/common/repositories/system/merchant/MerchantTypeRepository.php +++ b/app/common/repositories/system/merchant/MerchantTypeRepository.php @@ -14,6 +14,8 @@ namespace app\common\repositories\system\merchant; use app\common\dao\system\merchant\MerchantTypeDao; +use app\common\model\system\merchant\Merchant; +use app\common\model\system\merchant\MerchantType; use app\common\repositories\BaseRepository; use app\common\repositories\system\auth\MenuRepository; use app\common\repositories\system\RelevanceRepository; @@ -44,9 +46,11 @@ class MerchantTypeRepository extends BaseRepository return compact('count', 'list'); } - public function getSelect() + public function getSelect($getAll = true) { - $query = $this->search([])->field('mer_type_id,type_name'); + $query = MerchantType::getDB()->when(!$getAll, function ($query) { + $query->whereIn('mer_type_id', [Merchant::TypeCloudWarehouse, Merchant::TypeStore, Merchant::TypeSupplyChain, Merchant::TypePlatform]); + })->field('mer_type_id,type_name'); return $query->select()->toArray(); } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index b010941c..60d0699a 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -145,7 +145,7 @@ class MerchantIntention extends BaseController public function typeLst() { - $lst = app()->make(MerchantTypeRepository::class)->getSelect(); + $lst = app()->make(MerchantTypeRepository::class)->getSelect(false); return app('json')->success($lst); } }