40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\api\logic\VipOrderLogic;
|
|
use app\api\validate\VipOrderValidate;
|
|
|
|
class VipOrderController extends BaseApiController
|
|
{
|
|
public function levels()
|
|
{
|
|
return $this->data(VipOrderLogic::levels());
|
|
}
|
|
|
|
public function createOrder()
|
|
{
|
|
$params = (new VipOrderValidate())->post()->goCheck('createOrder', [
|
|
'user_id' => $this->userId,
|
|
'terminal' => $this->userInfo['terminal'],
|
|
]);
|
|
$result = VipOrderLogic::createOrder($params);
|
|
if (false === $result) {
|
|
return $this->fail(VipOrderLogic::getError());
|
|
}
|
|
return $this->data($result);
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = (new VipOrderValidate())->goCheck('detail', [
|
|
'user_id' => $this->userId,
|
|
]);
|
|
$result = VipOrderLogic::detail($params);
|
|
if (false === $result) {
|
|
return $this->fail(VipOrderLogic::getError());
|
|
}
|
|
return $this->data($result);
|
|
}
|
|
}
|