| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?php
- namespace app\workerapi\controller;
- use app\common\logic\MasterWorkerExamineLogic;
- 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','interview','getQuestion','getInterview','getRegInfo'];
- /**
- * @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) {
- \app\common\logic\MasterWorkerExamineLogic::updateEngineerInformation($this->userId);
- return $this->success('操作成功', [], 1, 1);
- }
- return $this->fail(MasterWorkerInfoLogic::getError());
- }
- public function getIdCard()
- {
- $result = MasterWorkerInfoLogic::getIdCard($this->userId);
- return $this->data($result);
- }
- 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) {
- \app\common\logic\MasterWorkerExamineLogic::updateEngineerInformation($this->userId);
- 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);
- }
- public function setInfo()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('setInfo');
- $result = MasterWorkerLogic::setInfo($this->userId, $params);
- if (false === $result) {
- return $this->fail(MasterWorkerLogic::getError());
- }
- return $this->success('操作成功', $result, 1, 1);
- }
- public function interview()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('interview');
- $result = MasterWorkerLogic::setInterview($params);
- if (false === $result) {
- return $this->fail(MasterWorkerLogic::getError());
- }
- return $this->success('操作成功', $result, 1, 1);
- }
- public function getInterview()
- {
- $params = (new MasterWokerValidate())->get()->goCheck('getInterview');
- $result = MasterWorkerLogic::getInterview($params);
- return $this->data($result);
- }
- public function getQuestion()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('question');
- $result = MasterWorkerLogic::getQuestion($params);
- return json(['code' => 1, 'data' => $result['list'],'text'=> $result['text'], 'msg' => 'success']);
- }
-
- public function getRegInfo()
- {
- $params = (new MasterWokerValidate())->post()->goCheck('getRegInfo');
- $result = MasterWorkerLogic::getRegInfo($params);
- echo $result;
- die;
- }
- }
|