|
@@ -3221,7 +3221,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构建待核销商品的数量映射
|
|
// 构建待核销商品的数量映射
|
|
|
- $stauts = 2;
|
|
|
|
|
|
|
+ $status = 2;
|
|
|
// foreach ($data as $v) {
|
|
// foreach ($data as $v) {
|
|
|
// $splitData[$v['product_id']] = $v['num'];
|
|
// $splitData[$v['product_id']] = $v['num'];
|
|
|
//
|
|
//
|
|
@@ -3239,7 +3239,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
throw new ValidateException('核销数量不能大于购买数量');
|
|
throw new ValidateException('核销数量不能大于购买数量');
|
|
|
}
|
|
}
|
|
|
if ($verify_num < $cart_info['cart_num']) { //核销数量小于购买数量
|
|
if ($verify_num < $cart_info['cart_num']) { //核销数量小于购买数量
|
|
|
- $stauts = 1;
|
|
|
|
|
|
|
+ $status = 1;
|
|
|
}
|
|
}
|
|
|
// $v['verify_num'] = \app\common\model\store\order\StoreCart::where('product_id',$v['product_id'])->where('cart_id',$v['cart_id'])->value('verify_num');
|
|
// $v['verify_num'] = \app\common\model\store\order\StoreCart::where('product_id',$v['product_id'])->where('cart_id',$v['cart_id'])->value('verify_num');
|
|
|
}
|
|
}
|
|
@@ -3250,7 +3250,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
// 更新订单状态为已核销,并设置核销时间和服务人员ID
|
|
// 更新订单状态为已核销,并设置核销时间和服务人员ID
|
|
|
$order->status = 2;
|
|
$order->status = 2;
|
|
|
$order->verify_uid = 2;
|
|
$order->verify_uid = 2;
|
|
|
- $order->verify_status = $stauts;
|
|
|
|
|
|
|
+ $order->verify_status = $status;
|
|
|
$order->verify_time = date('Y-m-d H:i:s');
|
|
$order->verify_time = date('Y-m-d H:i:s');
|
|
|
if ($order->verify_service_id > 0 && $order->verify_service_id != $serviceId) {
|
|
if ($order->verify_service_id > 0 && $order->verify_service_id != $serviceId) {
|
|
|
throw new ValidateException('部分核销过的订单不能换人核销');
|
|
throw new ValidateException('部分核销过的订单不能换人核销');
|
|
@@ -3267,7 +3267,8 @@ class StoreOrderRepository extends BaseRepository
|
|
|
// 执行订单核销后的处理逻辑
|
|
// 执行订单核销后的处理逻辑
|
|
|
// $this->takeAfter($order, $order->user);
|
|
// $this->takeAfter($order, $order->user);
|
|
|
// 保存更新后的订单信息
|
|
// 保存更新后的订单信息
|
|
|
- $order->save();
|
|
|
|
|
|
|
+ $res= $order->save();
|
|
|
|
|
+ var_dump($res);
|
|
|
// 构建订单状态变更信息
|
|
// 构建订单状态变更信息
|
|
|
$orderStatus = [
|
|
$orderStatus = [
|
|
|
'order_id' => $order->order_id,
|
|
'order_id' => $order->order_id,
|
|
@@ -3286,10 +3287,11 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$storeOrderStatusRepository->createAdminLog($orderStatus);
|
|
$storeOrderStatusRepository->createAdminLog($orderStatus);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- if ($stauts == 2) {
|
|
|
|
|
|
|
+ if ($status == 2) {
|
|
|
self::confirmOil($order);
|
|
self::confirmOil($order);
|
|
|
}
|
|
}
|
|
|
} catch (\think\Exception $exception) {
|
|
} catch (\think\Exception $exception) {
|
|
|
|
|
+ var_dump($exception->getLine());
|
|
|
throw new ValidateException($exception->getMessage());
|
|
throw new ValidateException($exception->getMessage());
|
|
|
}
|
|
}
|
|
|
// 触发订单核销完成后的事件
|
|
// 触发订单核销完成后的事件
|