|
|
|
|
@ -1713,7 +1713,6 @@ class OrdersController extends CommonController
|
|
|
|
|
* summary="V2-更新订单状态",
|
|
|
|
|
* description="更新订单状态",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Parameter(name="id", in="query", @OA\Schema(type="integer"), required=true, description="订单ID"),
|
|
|
|
|
* @OA\Parameter(name="from_status", in="query", @OA\Schema(type="integer"), required=true, description="原状态"),
|
|
|
|
|
* @OA\Parameter(name="to_status", in="query", @OA\Schema(type="integer"), required=true, description="更新状态"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
@ -1726,6 +1725,14 @@ class OrdersController extends CommonController
|
|
|
|
|
public function changeOrderStatus($id)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$manager = $this->guard()->user();
|
|
|
|
|
if (!$manager->order_status_ability) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
"errorcode" => "4003",
|
|
|
|
|
"errormsg" => "权限不足"
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$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();
|
|
|
|
|
|