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); } public function setInfo() { $params = (new MasterWokerValidate())->post()->goCheck('setInfo'); $result = MasterWorkerLogic::setInfo($this->userId, $params); if (false === $result) { return $this->fail(MasterWorkerLogic::getError(),['code'=>MasterWorkerLogic::getReturnCode()]); } return $this->success('操作成功', [], 1, 1); } }