mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 07:59:11 +08:00
update: order success handle
This commit is contained in:
parent
b0c818c661
commit
0288d2df4b
@ -76,10 +76,20 @@ class OrderController extends Controller
|
|||||||
abort(500, '订单不存在');
|
abort(500, '订单不存在');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($params['status']) && (int)$params['status'] === 2) {
|
if (isset($params['status'])) {
|
||||||
$orderService = new OrderService($order);
|
$orderService = new OrderService($order);
|
||||||
if (!$orderService->cancel()) {
|
switch ((int)$params['status']) {
|
||||||
abort(500, '更新失败');
|
case 1: {
|
||||||
|
if (!$orderService->success(time())) {
|
||||||
|
abort(500, '更新失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
|
if (!$orderService->cancel()) {
|
||||||
|
abort(500, '更新失败');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => true
|
'data' => true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user