|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Controller; |
|
|
|
|
|
|
|
use App\Constants\ErrorCode; |
|
|
|
use App\Request\OrderOnlineRequest; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use App\Service\OrderServiceInterface; |
|
|
|
@ -20,8 +21,8 @@ class OrderController extends BaseController |
|
|
|
{ |
|
|
|
$orderMainId = $this->orderService->addOnlineOrder($request->validated()); |
|
|
|
if (!is_int($orderMainId)) { |
|
|
|
return $this->w7result(500, (string)$orderMainId); |
|
|
|
return $this->result(ErrorCode::ORDER_FAILURE, '', $orderMainId); |
|
|
|
} |
|
|
|
return $this->w7result(200, (string)$orderMainId); |
|
|
|
return $this->success(['order_id' => $orderMainId]); |
|
|
|
} |
|
|
|
} |