更新
This commit is contained in:
parent
039d696b9b
commit
5f43305313
@ -129,7 +129,7 @@ class SpuRepository extends BaseRepository
|
|||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 12/18/20
|
* @day 12/18/20
|
||||||
*/
|
*/
|
||||||
public function getApiSearch($where, $page, $limit, $userInfo = null)
|
public function getApiSearch($where, $page, $limit, $userInfo = null,$is_sku=false)
|
||||||
{
|
{
|
||||||
if (isset($where['keyword']) && !empty($where['keyword'])) {
|
if (isset($where['keyword']) && !empty($where['keyword'])) {
|
||||||
if (preg_match('/^(\/@[1-9]{1}).*\*\//', $where['keyword'])) {
|
if (preg_match('/^(\/@[1-9]{1}).*\*\//', $where['keyword'])) {
|
||||||
@ -154,7 +154,13 @@ class SpuRepository extends BaseRepository
|
|||||||
]);
|
]);
|
||||||
$productMake = app()->make(ProductRepository::class);
|
$productMake = app()->make(ProductRepository::class);
|
||||||
$count = $query->fetchSql(false)->count();
|
$count = $query->fetchSql(false)->count();
|
||||||
$list = $query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->select();
|
$list = $query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->select()
|
||||||
|
->each(function ($item) use ($is_sku,$productMake,$userInfo) {
|
||||||
|
if($is_sku==true){
|
||||||
|
$sku = $productMake->detailAttrValue($item['product']['attrValue'], $userInfo);
|
||||||
|
$item['sku']=$sku;
|
||||||
|
}
|
||||||
|
});
|
||||||
$append = ['stop_time','svip_price','show_svip_info','is_svip_price'];
|
$append = ['stop_time','svip_price','show_svip_info','is_svip_price'];
|
||||||
if ($productMake->getUserIsPromoter($userInfo))
|
if ($productMake->getUserIsPromoter($userInfo))
|
||||||
$append[] = 'max_extension';
|
$append[] = 'max_extension';
|
||||||
|
@ -149,14 +149,13 @@ class CloudWarehouse extends BaseController
|
|||||||
if (empty($merchantIds)) {
|
if (empty($merchantIds)) {
|
||||||
return app('json')->success(['count' => 0, 'list' => []]);
|
return app('json')->success(['count' => 0, 'list' => []]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$where['entry_mer_id'] = 0;
|
$where['entry_mer_id'] = 0;
|
||||||
$where['keyword'] = $params['keyword'];
|
$where['keyword'] = $params['keyword'];
|
||||||
$where['mer_ids'] = $merchantIds;
|
$where['mer_ids'] = $merchantIds;
|
||||||
$where['product_type'] = $params['product_type'];
|
$where['product_type'] = $params['product_type'];
|
||||||
$where['is_gift_bag'] = 0;
|
$where['is_gift_bag'] = 0;
|
||||||
$where['order'] = $params['order'] ?: 'sort';
|
$where['order'] = $params['order'] ?: 'sort';
|
||||||
$products = $this->spuRepository->getApiSearch($where, $page, $limit, false);
|
$products = $this->spuRepository->getApiSearch($where, $page, $limit, false,true);
|
||||||
return app('json')->success($products);
|
return app('json')->success($products);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user