| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace addons\OperationCenter\backend\controllers;
- use addons\OperationCenter\common\services\CenterService;
- /**
- * 运营中心控制器
- *
- * Class CenterController
- * @package addons\OperationCenter\backend\controllers
- */
- class CenterController extends BaseController
- {
- /**
- * @var CenterService
- */
- protected $service;
- public function init()
- {
- parent::init();
- $this->service = new CenterService(['mall_id' => $this->mall_id]);
- }
- /**
- * 首页
- *
- * @return string
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- $params = $this->request->get();
- return $this->success('ok', $this->service->getPageList($params));
- }
- return $this->render($this->action->id);
- }
- /**
- * 删除
- *
- * @return string
- */
- public function actionDelUser()
- {
- $id = $this->request->get('id', 0);
- return $this->service->delUser($id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- }
|