|
@@ -130,8 +130,16 @@ class OrdersReceipt extends Auth{
|
|
|
$result = $Model->edit($id,['status'=>$status,'remark'=>$remark,'admin_uid'=>admin('uid')]);
|
|
|
// 提示新增失败
|
|
|
if( !$result ) return json_send(['code'=>'error','msg'=>'操作失败']);
|
|
|
- // 恢复订单进行中
|
|
|
- $result = $Orders->setOrderStatus($oldData['order_id'],1,$OrdersProduct);
|
|
|
+ $ordersInfo = $Orders->where(['id'=>$oldData['order_id']])->first();
|
|
|
+ if (!$ordersInfo) return json_send(['code'=>'error','msg'=>'操作失败,订单不存在']);
|
|
|
+ $ordersInfo = $ordersInfo->toArray();
|
|
|
+ if ($ordersInfo['is_pay']){
|
|
|
+ // 恢复订单待收货
|
|
|
+ $result = $Orders->setOrderStatus($oldData['order_id'],2,$OrdersProduct);
|
|
|
+ }else{
|
|
|
+ // 恢复订单进行中
|
|
|
+ $result = $Orders->setOrderStatus($oldData['order_id'],1,$OrdersProduct);
|
|
|
+ }
|
|
|
// 提示新增失败
|
|
|
if( isset($result['error']) ){
|
|
|
// 回退数据
|