回收订单改状态

wysf
ztt 11 months ago
parent 94ea0a073e
commit 0b34ad756e
  1. 14
      app/api/controller/Recovery.php

@ -134,11 +134,17 @@ class Recovery extends Controller
if (empty($params['order_id']) || empty($params['recovery_id']) || empty($params['status'])) { if (empty($params['order_id']) || empty($params['recovery_id']) || empty($params['status'])) {
return $this->renderError('缺少必要参数'); return $this->renderError('缺少必要参数');
} }
$model = new RecoveryOrder();
$res = $model->save(['order_status' => $params['status']]); $model = (new RecoveryOrder())::detail($params['order_id']);
if ($res) { if ($model) {
return $this->renderSuccess('更新成功'); if($params['status'] == RecoveryStatusEnum::ALREADY || $params['status'] == RecoveryStatusEnum::FINISN) {
$res = $model->save(['order_status' => $params['status']]);
if ($res) {
return $this->renderSuccess('更新成功');
}
}
} }
return $this->renderError('更新失败'); return $this->renderError('更新失败');
} }

Loading…
Cancel
Save