input('id'); //订单ID $user = User::firstWhere(['id' => $this->user_id, 'status' => 1]); if (!$user || $user->verifier != 1) { return $this->error('对不起,你没有核销权限,请联系管理员'); } $order = Order::query()->where('agent_id', $this->agent_id)->find($id); if (!$order) { return $this->error('订单不存在或无权限'); } if (!in_array($order->status, [OrderStatus::PAID, OrderStatus::PAY_RETAINAGE])) { return $this->error('当前订单状态不允许核销'); } $order->status = 16; $order->save(); return $this->success(); } }