Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
ab746594ae
@ -40,13 +40,13 @@ class CartController extends BaseApiController
|
||||
return $this->fail('购物车商品不能大于100个,请先结算');
|
||||
}
|
||||
//数量下单判断
|
||||
$stock = StoreBranchProduct::where(
|
||||
['product_id'=>$params['product_id'],
|
||||
'store_id'=>$params['store_id']
|
||||
])->value('stock')??0;
|
||||
if ($params['cart_num'] >$stock) {
|
||||
return $this->fail('库存数量不足');
|
||||
}
|
||||
// $stock = StoreBranchProduct::where(
|
||||
// ['product_id'=>$params['product_id'],
|
||||
// 'store_id'=>$params['store_id']
|
||||
// ])->value('stock')??0;
|
||||
// if ($params['cart_num'] >$stock) {
|
||||
// return $this->fail('库存数量不足');
|
||||
// }
|
||||
if ($result) {
|
||||
if(isset($params['type']) && $params['type'] == 1){
|
||||
$res = CartLogic::add($params);
|
||||
|
@ -89,10 +89,10 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
||||
}else{
|
||||
$order = [$field => $order];
|
||||
}
|
||||
$fields = 'id,product_id,cate_id,store_name,cost,store_id,vip_price,purchase,price,bar_code,image,sales,store_info,delete_time,unit,batch,top_cate_id,two_cate_id';
|
||||
$fields = 'id,product_id,cate_id,store_name,cost,store_id,vip_price,purchase,price,bar_code,image,sales,store_info,delete_time,unit,batch,top_cate_id,two_cate_id,stock';
|
||||
|
||||
$this->searchWhere[] = ['status', '=', 1];
|
||||
$this->searchWhere[] = ['stock', '>', 0];
|
||||
// $this->searchWhere[] = ['stock', '>', 0];
|
||||
return StoreBranchProduct::where($this->searchWhere)
|
||||
->field($fields)
|
||||
->with(['className', 'unitName'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user