Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-php into dev
This commit is contained in:
commit
019ae88296
@ -1323,19 +1323,17 @@ class ProductRepository extends BaseRepository
|
||||
->where('mer_id',$merId);
|
||||
$data = [];
|
||||
$count = $query->count();
|
||||
|
||||
if ($count < 3) {
|
||||
$productIds[] = $productId;
|
||||
$data = $this->dao->getSearch([])
|
||||
->where($this->dao->productShow())
|
||||
->whereNotIn('product_id',$productIds)
|
||||
->where('mer_id', $merId)
|
||||
->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time')
|
||||
->order('sort DESC,create_time DESC')
|
||||
->limit((3 - $count))
|
||||
->select()->toArray();
|
||||
}
|
||||
|
||||
// if ($count < 3) {
|
||||
// $productIds[] = $productId;
|
||||
// $data = $this->dao->getSearch([])
|
||||
// ->where($this->dao->productShow())
|
||||
// ->whereNotIn('product_id',$productIds)
|
||||
// ->where('mer_id', $merId)
|
||||
// ->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time')
|
||||
// ->order('sort DESC,create_time DESC')
|
||||
// ->limit((3 - $count))
|
||||
// ->select()->toArray();
|
||||
// }
|
||||
if ($count > 0 ){
|
||||
$count = $count > 3 ? 3 : $count;
|
||||
$res = $query->setOption('field',[])->field('mer_id,product_id,store_name,image,price,is_show,status,is_gift_bag,is_good,sales,create_time')
|
||||
|
Loading…
x
Reference in New Issue
Block a user