58 lines
1.5 KiB
PHP
58 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace app\adminapi\controller\popup;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\lists\popup\PopupLists;
|
|
use app\adminapi\logic\popup\PopupLogic;
|
|
use app\adminapi\validate\popup\PopupValidate;
|
|
|
|
/**
|
|
* 页面弹窗管理
|
|
*/
|
|
class PopupController extends BaseAdminController
|
|
{
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new PopupLists());
|
|
}
|
|
|
|
public function add()
|
|
{
|
|
$params = (new PopupValidate())->post()->goCheck('add');
|
|
PopupLogic::add($params);
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$params = (new PopupValidate())->post()->goCheck('edit');
|
|
$result = PopupLogic::edit($params);
|
|
if ($result === true) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(PopupLogic::getError());
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
$params = (new PopupValidate())->post()->goCheck('delete');
|
|
PopupLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = (new PopupValidate())->goCheck('detail');
|
|
$result = PopupLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
public function updateStatus()
|
|
{
|
|
$params = (new PopupValidate())->post()->goCheck('status');
|
|
PopupLogic::updateStatus($params);
|
|
return $this->success('修改成功', [], 1, 1);
|
|
}
|
|
}
|