weizong song 4 years ago
parent ccc1f99393
commit 25c2942974

@ -1727,6 +1727,16 @@ class OrdersController extends CommonController
{
try {
$order = (new Orders())->find($id);
if (request()->to_status == Orders::STATUS_ONGOING) {
$other_ongoing_order = Orders::where("status", Orders::STATUS_ONGOING)->where("customer_id", $order->customer_id)->count();
if ($other_ongoing_order) {
return response()->json([
"errorcode" => "2222",
"errormsg" => "客户名下有其他进行中的该订单"
]);
}
}
$res = (new ChangeOrderStatus())->__invoke($order);
DB::commit();
return response()->json($order->toArray());

Loading…
Cancel
Save