diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index baefe349..c7295efb 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -311,7 +311,7 @@ class MerchantRepository extends BaseRepository app()->make(UserVisitRepository::class)->searchMerchant($userInfo ? $userInfo['uid'] : 0, $where['keyword']); } $query = $this->dao->search($where)->with(['type_name']); - $count = $query->count(); + $count = $query->fetchSql()->count(); $status = systemConfig('mer_location'); /** @var MerchantTakeRepository $repository */ $repository = app()->make(MerchantTakeRepository::class); diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 42653874..019eb28a 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -57,7 +57,8 @@ class Merchant extends BaseController [$page, $limit] = $this->getPage(); $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader', 'street_id', 'credit_buy']); if (empty($where['type_id'])) { - $where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform]; + //$where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform]; + $where['type_id'] = [MerchantModel::TypeTownSupplyChain, MerchantModel::TypeStore]; } return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo)); }