| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- namespace app\workerapi\controller;
- use app\common\model\dict\DictData;
- use app\workerapi\logic\LoginLogic;
- use app\workerapi\logic\MasterWorkerInfoLogic;
- use app\workerapi\logic\MasterWorkerLogic;
- use app\workerapi\validate\BankAccountValidate;
- use app\workerapi\validate\MasterWokerInfoValidate;
- use app\workerapi\validate\MasterWokerValidate;
- class MasterWorkerController extends BaseApiController
- {
- public array $notNeedLogin = ['customerPhone'];
- /**
- * @notes 修改密码
- * @return \think\response\Json
- * @author 段誉
- * @date 2022/9/20 19:16
- */
- public function changePassword()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('changePassword');
- $result = MasterWorkerLogic::changePassword($params, $this->userId);
- if (true === $result) {
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerLogic::getError());
- }
- /**
- * 更改手机号
- * @return \think\response\Json
- * @author 林海涛
- * @date 2024/7/10 下午2:23
- */
- public function changeMobile()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('changeMobile');
- $result = MasterWorkerLogic::changeMobile($params, $this->userId);
- if (true === $result) {
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerLogic::getError());
- }
- /**
- * 更改身份证信息
- * @return \think\response\Json
- * @author 林海涛
- * @date 2024/7/10 下午4:46
- */
- public function changeIdCard()
- {
- $params = (new MasterWokerInfoValidate())->post()->goCheck('changeIdCard');
- $result = MasterWorkerInfoLogic::changeIdCard($params, $this->userId);
- if (true === $result) {
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerInfoLogic::getError());
- }
- public function approvalStopWork()
- {
- $result = MasterWorkerLogic::stopWork($this->userId);
- if (true === $result) {
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerLogic::getError());
- }
- /**
- * 注销账号
- * @return \think\response\Json
- * @author 林海涛
- * @date 2024/7/10 下午4:46
- */
- public function logOff()
- {
- $result = MasterWorkerLogic::logOff($this->userId);
- if (true === $result) {
- LoginLogic::logout($this->userInfo);
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerInfoLogic::getError());
- }
- /**
- * 绑定银行卡
- * @return \think\response\Json
- * @author 林海涛
- * @date 2024/7/11 下午4:27
- */
- public function bindBankAccount()
- {
- $params = (new BankAccountValidate())->post()->goCheck('bindBankAccount');
- $result = MasterWorkerInfoLogic::bindBankAccount($params, $this->userId);
- if (true === $result) {
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerInfoLogic::getError());
- }
- public function myInfo()
- {
- $result = MasterWorkerLogic::detail($this->userId);
- return $this->data($result);
- }
- public function bankAccountInfo()
- {
- $result = MasterWorkerInfoLogic::bankAccountInfo($this->userId);
- return $this->data($result);
- }
- /**
- * 客服电话
- * @return \think\response\Json
- */
- public function customerPhone()
- {
- $result = DictData::where(['type_value' => 'customer_support'])->column('value', 'name');
- return $this->data($result);
- }
- }
|