|
@@ -3222,17 +3222,18 @@ class StoreOrderRepository extends BaseRepository
|
|
|
|
|
|
|
|
// 构建待核销商品的数量映射
|
|
// 构建待核销商品的数量映射
|
|
|
$stauts = 2;
|
|
$stauts = 2;
|
|
|
- foreach ($data as $v) {
|
|
|
|
|
- $splitData[$v['product_id']] = $v['num'];
|
|
|
|
|
- $cart_info = StoreCart::where(['cart_id' => $v['id'], 'product_id' => $v['product_id']])->find();
|
|
|
|
|
- $verify_num = bcadd($cart_info['verify_num'], $v['num'], 0);
|
|
|
|
|
- if ($verify_num > $cart_info['cart_num']) {
|
|
|
|
|
- throw new ValidateException('核销数量不能大于购买数量');
|
|
|
|
|
- }
|
|
|
|
|
- if ($verify_num < $cart_info['cart_num']) { //核销数量小于购买数量
|
|
|
|
|
- $stauts = 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// foreach ($data as $v) {
|
|
|
|
|
+// $splitData[$v['product_id']] = $v['num'];
|
|
|
|
|
+// $cart_info = StoreCart::where(['cart_id' => $order['cart_id'], 'product_id' => $v['product_id']])->find();
|
|
|
|
|
+// $verify_num = bcadd($cart_info['verify_num'], $v['num'], 0);
|
|
|
|
|
+// if ($verify_num > $cart_info['cart_num']) {
|
|
|
|
|
+// throw new ValidateException('核销数量不能大于购买数量');
|
|
|
|
|
+// }
|
|
|
|
|
+// if ($verify_num < $cart_info['cart_num']) { //核销数量小于购买数量
|
|
|
|
|
+// $stauts = 1;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+ var_dump($order);die();
|
|
|
// 调用订单分割函数进行订单核销操作,并更新订单对象
|
|
// 调用订单分割函数进行订单核销操作,并更新订单对象
|
|
|
// $spl = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData, $serviceId, 1);
|
|
// $spl = app()->make(StoreOrderSplitRepository::class)->splitOrder($order, $splitData, $serviceId, 1);
|
|
|
// if ($spl) $order = $spl;
|
|
// if ($spl) $order = $spl;
|