diff --git a/app/api/controller/Recovery.php b/app/api/controller/Recovery.php index 909b7b2c..b6325d42 100644 --- a/app/api/controller/Recovery.php +++ b/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'])) { return $this->renderError('缺少必要参数'); } - $model = new RecoveryOrder(); - $res = $model->save(['order_status' => $params['status']]); - if ($res) { - return $this->renderSuccess('更新成功'); + + $model = (new RecoveryOrder())::detail($params['order_id']); + if ($model) { + if($params['status'] == RecoveryStatusEnum::ALREADY || $params['status'] == RecoveryStatusEnum::FINISN) { + $res = $model->save(['order_status' => $params['status']]); + if ($res) { + return $this->renderSuccess('更新成功'); + } + } } + return $this->renderError('更新失败'); }