Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
bc5a7d78f5
@ -289,14 +289,14 @@ class OrderLogic extends BaseLogic
|
|||||||
//检查购物车对比店铺得商品数量差异
|
//检查购物车对比店铺得商品数量差异
|
||||||
foreach ($cart_select as $v) {
|
foreach ($cart_select as $v) {
|
||||||
$store = StoreBranchProduct::where([
|
$store = StoreBranchProduct::where([
|
||||||
'store_id'=>$v['store_id'],
|
'store_id'=>$params['store_id'],
|
||||||
'product_id'=>$v['product_id'],
|
'product_id'=>$v['product_id'],
|
||||||
])->field('id,store_name,stock')->withTrashed()->find();
|
])->field('id,store_name,stock')->withTrashed()->find();
|
||||||
if($store['stock'] < $v['cart_num']){
|
if($store['stock'] < $v['cart_num']){
|
||||||
//缺失
|
//缺失
|
||||||
$newArr[] = [
|
$newArr[] = [
|
||||||
'uid'=>$uid,
|
'uid'=>$uid,
|
||||||
'store_id'=>$v['store_id'],
|
'store_id'=>$params['store_id'],
|
||||||
'product_id'=>$v['product_id'],
|
'product_id'=>$v['product_id'],
|
||||||
'missing_quantity'=> $v['cart_num'] - $store['stock']
|
'missing_quantity'=> $v['cart_num'] - $store['stock']
|
||||||
];
|
];
|
||||||
|
@ -24,6 +24,7 @@ class OrderValidate extends BaseValidate
|
|||||||
'old_cart_id' => 'require|array',
|
'old_cart_id' => 'require|array',
|
||||||
'refund_type' => 'require|number',
|
'refund_type' => 'require|number',
|
||||||
'cart_id' => 'require',
|
'cart_id' => 'require',
|
||||||
|
'store_id' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -39,11 +40,12 @@ class OrderValidate extends BaseValidate
|
|||||||
'old_cart_id' => '购物车id',
|
'old_cart_id' => '购物车id',
|
||||||
'refund_type' => '退款申请类型',
|
'refund_type' => '退款申请类型',
|
||||||
'cart_id' => '购物车id',
|
'cart_id' => '购物车id',
|
||||||
|
'store_id' => '店铺id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function sceneCart()
|
public function sceneCart()
|
||||||
{
|
{
|
||||||
return $this->only(['cart_id']);
|
return $this->only(['cart_id','store_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,7 +105,11 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
self::afterPay($order);
|
self::afterPay($order);
|
||||||
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
||||||
self::dealGoodsLeft($order['cart_id'],$order['uid'],$order['id']);
|
$checkArr =[
|
||||||
|
'cart_id'=>$order['cart_id'],
|
||||||
|
'store_id'=>$order['store_id'],
|
||||||
|
];
|
||||||
|
self::dealGoodsLeft($checkArr,$order['uid'],$order['id']);
|
||||||
}
|
}
|
||||||
if ($extra && $extra['store_id']) {
|
if ($extra && $extra['store_id']) {
|
||||||
$params = [
|
$params = [
|
||||||
@ -219,7 +223,11 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
self::dealProductLog($order);
|
self::dealProductLog($order);
|
||||||
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
||||||
self::dealGoodsLeft($order['cart_id'],$order['uid'],$order['id']);
|
$checkArr =[
|
||||||
|
'cart_id'=>$order['cart_id'],
|
||||||
|
'store_id'=>$order['store_id'],
|
||||||
|
];
|
||||||
|
self::dealGoodsLeft($checkArr,$order['uid'],$order['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $count = UserSign::where([
|
// $count = UserSign::where([
|
||||||
@ -413,7 +421,11 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$order->save();
|
$order->save();
|
||||||
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
if($order['reservation'] == 1&& in_array($order['shipping_type'],[1,2])){
|
||||||
self::dealGoodsLeft($order['cart_id'],$order['uid'],$order['id']);
|
$checkArr =[
|
||||||
|
'cart_id'=>$order['cart_id'],
|
||||||
|
'store_id'=>$order['store_id'],
|
||||||
|
];
|
||||||
|
self::dealGoodsLeft($checkArr,$order['uid'],$order['id']);
|
||||||
}
|
}
|
||||||
self::afterPay($order, $extra['transaction_id']);
|
self::afterPay($order, $extra['transaction_id']);
|
||||||
// self::addUserSing($order);
|
// self::addUserSing($order);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user