diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index aeca0f2e..46237a44 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -65,15 +65,16 @@ class SpuDao extends BaseDao $query->whereIn('P.mer_id',$where['mer_ids']); }) ->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){ + $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%"); if (is_numeric($where['keyword'])) { - $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%"); + // $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%"); } else { - $word = app()->make(VicWordService::class)->getWord($where['keyword']); - $query->where(function ($query) use ($word) { - foreach ($word as $item) { - $query->whereOr('S.store_name|S.keyword', 'LIKE', "%$item%"); - } - }); + // $word = app()->make(VicWordService::class)->getWord($where['keyword']); + // $query->where(function ($query) use ($word) { + // foreach ($word as $item) { + // $query->whereOr('S.store_name|S.keyword', 'LIKE', "%$item%"); + // } + // }); } }) ->when(isset($where['is_trader']) && $where['is_trader'] !== '',function($query)use($where){ diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index dafef786..d1366b86 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -42,7 +42,7 @@ class StoreSpu extends BaseController public function lst() { [$page, $limit] = $this->getPage(); - $typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id'); + $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id'); $where = $this->request->params([ 'keyword', 'cate_id', @@ -63,7 +63,7 @@ class StoreSpu extends BaseController $where['is_gift_bag'] = 0; $where['product_type'] = 0; $where['order'] = $where['order'] ?: 'star'; - $where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeStoreId) + $where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeTownSupplyChainId) ->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); if ($where['is_trader'] != 1) unset($where['is_trader']); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);