feat(OrderController): 修改拆单逻辑,增加退款判断

This commit is contained in:
mkm 2024-07-29 15:06:33 +08:00
parent 2d3b99b370
commit fa559efd5c
2 changed files with 4 additions and 4 deletions

View File

@ -456,9 +456,9 @@ class OrderController extends BaseApiController
$params = (new OrderValidate())->post()->goCheck('add'); $params = (new OrderValidate())->post()->goCheck('add');
$uid = $this->userId; $uid = $this->userId;
//拆单逻辑 //拆单逻辑
OrderLogic::dealRefund($uid, $params); $res=OrderLogic::dealRefund($uid, $params);
$detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->where('status','in',[0,1])->find(); $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->find();
if($detail){ if($detail && $res!=2){
$res=StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); $res=StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]);
if($res!=false){ if($res!=false){
return $this->success($res); return $this->success($res);

View File

@ -832,7 +832,7 @@ class OrderLogic extends BaseLogic
} }
} }
return 1; return $order['status']??1;
} }