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); } }