更新
This commit is contained in:
parent
85df1c8bc7
commit
856c57f9bf
@ -116,7 +116,7 @@ class StoreGroupOrderOtherRepository extends BaseRepository
|
||||
}, 'orderProduct', 'presellOrder']);
|
||||
}, 'interest'])
|
||||
->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->find();
|
||||
if ($order['paid'] == 1 && $order['pay_type'] != 8) {
|
||||
if ($order['paid'] == 1) {
|
||||
throw new DataNotFoundException('订单不存在或已取消');
|
||||
}
|
||||
if (empty($order)) {
|
||||
|
@ -150,7 +150,8 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
{
|
||||
$groupOrder->append(['user']);
|
||||
//修改订单状态
|
||||
Db::transaction(function () use ($subOrders, $is_combine, $groupOrder) {
|
||||
Db::startTrans();
|
||||
try {
|
||||
$time = date('Y-m-d H:i:s');
|
||||
$groupOrder->paid = 1;
|
||||
$groupOrder->pay_time = $time;
|
||||
@ -171,7 +172,8 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
$storeOrderStatusRepository = app()->make(StoreOrderStatusOtherRepository::class);
|
||||
$svipDiscount = 0;
|
||||
foreach ($groupOrder->orderList as $_k => $order) {
|
||||
$order->paid = 1;
|
||||
$order->paid = 2;
|
||||
$order->order_extend = $groupOrder->order_extend;
|
||||
$order->pay_time = $time;
|
||||
$svipDiscount = bcadd($order->svip_discount, $svipDiscount, 2);
|
||||
if (isset($subOrders[$order->order_sn])) {
|
||||
@ -318,8 +320,13 @@ class StoreOtherOrderRepository extends BaseRepository
|
||||
$financialRecordRepository->insertAll($finance);
|
||||
$storeOrderStatusRepository->batchCreateLog($orderStatus);
|
||||
$groupOrder->save();
|
||||
});
|
||||
return true;
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
// 回滚事务
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user