From 1496e33d766671deca83c10625d79d23626e774c Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 25 Aug 2023 15:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=97=E9=93=BA=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantTypeRepository.php | 11 ++++++++++- .../api/store/merchant/MerchantIntention.php | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/system/merchant/MerchantTypeRepository.php b/app/common/repositories/system/merchant/MerchantTypeRepository.php index b29fe252..dfa9eb94 100644 --- a/app/common/repositories/system/merchant/MerchantTypeRepository.php +++ b/app/common/repositories/system/merchant/MerchantTypeRepository.php @@ -49,9 +49,18 @@ class MerchantTypeRepository extends BaseRepository return compact('count', 'list'); } - public function getSelect($getAll = true) + public function getSelect($getAll = true, $siftStore = false) { $merTypeIds = $this->userApply ? Merchant::AllowApply : Merchant::AllowDisplay; + // 特殊处理市级云仓 + // Merchant::TypeSupplyChain + if ($siftStore == true) { + foreach($merTypeIds as $k=>$v) { + if ($v == Merchant::TypeSupplyChain) { + unset($merTypeIds[$k]); + } + } + } $query = MerchantType::getDB()->when(!$getAll, function ($query) use ($merTypeIds) { $query->whereIn('mer_type_id', $merTypeIds); })->field('mer_type_id,type_name'); diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 3805402d..07c3f38c 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -160,9 +160,10 @@ class MerchantIntention extends BaseController public function typeLst() { /** @var MerchantTypeRepository $repo */ + $siftStore = $this->request->param('sift_store', 0); $repo = app()->make(MerchantTypeRepository::class); $repo->userApply = true; - $lst = $repo->getSelect(false); + $lst = $repo->getSelect(false, $siftStore); return app('json')->success($lst); } }