| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace addons\OperationCenter\backend\controllers;
- use addons\OperationCenter\common\services\ReviewService;
- /**
- * 审核控制器
- *
- * Class ReviewController
- * @package addons\OperationCenter\backend\controllers
- */
- class ReviewController extends BaseController
- {
- /**
- * @var boolean
- */
- public $enableCsrfValidation = false;
- /**
- * @var ReviewService
- */
- protected $service;
- public function init()
- {
- parent::init();
- $this->service = new ReviewService(['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 actionPass()
- {
- $id = $this->request->get('id');
- $level_id = $this->request->post('level');
- return $this->service->pass($id, $level_id)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- /**
- * 驳回
- *
- * @return string
- */
- public function actionReject()
- {
- $id = $this->request->get('id');
- $content = $this->request->post('content');
- return $this->service->reject($id, $content)
- ? $this->success('ok')
- : $this->error($this->service->getError());
- }
- }
|