diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index be00fdfb..299cbc2b 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -456,9 +456,9 @@ class OrderController extends BaseApiController $params = (new OrderValidate())->post()->goCheck('add'); $uid = $this->userId; //拆单逻辑 - OrderLogic::dealRefund($uid, $params); - $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->where('status','in',[0,1])->find(); - if($detail){ + $res=OrderLogic::dealRefund($uid, $params); + $detail = StoreOrder::where('id', $params['id'])->where('refund_type',1)->find(); + if($detail && $res!=2){ $res=StoreOrderLogic::refund($detail,['order_id'=>$detail['order_id']]); if($res!=false){ return $this->success($res); diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 59e2cfee..b6d29628 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -834,7 +834,7 @@ class OrderLogic extends BaseLogic } } - return 1; + return $order['status']??1; } diff --git a/app/store/logic/WorkbenchLogic.php b/app/store/logic/WorkbenchLogic.php index 9adaf4a7..6988ba07 100644 --- a/app/store/logic/WorkbenchLogic.php +++ b/app/store/logic/WorkbenchLogic.php @@ -66,6 +66,7 @@ class WorkbenchLogic extends BaseLogic $storeFinanceWhere['store_id'] = $params['store_id']; $storeFinanceWhereTwo['store_id'] = $params['store_id']; $attritionWhere['id'] = $params['store_id']; + $all_where['store_id'] = $params['store_id']; } $orderLogic = new StoreOrderLogic(); //订单总金额