| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- namespace addons\AvoidTax\backend\controllers;
- use addons\AvoidTax\common\service\AuthService;
- use common\enums\ApiStatusEnum;
- /**
- * 实名认证
- *
- * Class AuthController
- * @package addons\AvoidTax\backend\controllers
- */
- class AuthController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * @var AuthService
- */
- protected $service;
- public function init()
- {
- parent::init();
- $this->service = new AuthService(['mall_id' => $this->mall_id]);
- }
- /**
- * 列表
- *
- * @return void
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- return $this->success(
- 'ok',
- $this->service->getList(
- array_merge(
- $this->request->getBodyParams(),
- $this->request->get(),
- )
- ),
- ApiStatusEnum::CODE_SUCCESS,
- JSON_UNESCAPED_UNICODE
- );
- }
- return $this->render($this->action->id);
- }
- /**
- * 信息修改
- *
- * @return void
- */
- public function actionChange()
- {
- if ($this->request->isPost) {
- $id = $this->request->get('id');
- $mobile = $this->request->post('mobile');
- $account = $this->request->post('account');
-
- return $this->service->changeMobile($id, $mobile, $account)
- ? $this->success()
- : $this->error($this->service->getError());
- }
- }
- /**
- * 转换
- *
- * @return void
- */
- public function actionConvert()
- {
- if ($this->request->isAjax) {
- $this->service->convert();
- return $this->success('转换任务已添加,请等待');
- }
- }
- /**
- * 解除绑定
- *
- * @return void
- */
- public function actionUnbind()
- {
- if ($this->request->isAjax) {
- $id = $this->request->get('id');
- return $this->service->unbind($id)
- ? $this->success('解除成功')
- : $this->error($this->service->getError());
- }
- }
- }
|