48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace app\adminapi\controller\lottery;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\lists\lottery\LotteryCategoryLists;
|
|
use app\adminapi\logic\lottery\LotteryCategoryLogic;
|
|
use app\adminapi\validate\lottery\LotteryCategoryValidate;
|
|
|
|
class LotteryCategoryController extends BaseAdminController
|
|
{
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new LotteryCategoryLists());
|
|
}
|
|
|
|
public function add()
|
|
{
|
|
$params = (new LotteryCategoryValidate())->post()->goCheck('add');
|
|
LotteryCategoryLogic::add($params);
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$params = (new LotteryCategoryValidate())->post()->goCheck('edit');
|
|
$result = LotteryCategoryLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(LotteryCategoryLogic::getError());
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
$params = (new LotteryCategoryValidate())->post()->goCheck('delete');
|
|
LotteryCategoryLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = (new LotteryCategoryValidate())->goCheck('detail');
|
|
$result = LotteryCategoryLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
}
|