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; } public function getCredential() { $params = request()->get(); $result = MasterWorkerRegisterLogic::credential($this->userId,$params['image_name']??''); return $this->data($result); } public function setCredential() { $params = request()->post(); $result = MasterWorkerRegisterLogic::setCredential($params,$this->userId); if (false === $result) { return $this->fail(MasterWorkerRegisterLogic::getError()); } return $this->success('操作成功', [], 1, 1); } public function getAltitudeCredential() { $params = request()->get(); if(in_array($params['credential_type'],[52,109])){ $result = MasterWorkerRegisterLogic::credential($this->userId,'高处作业',1); if($result){ return $this->success('', ['isAltitude'=>$result?1:0], 1, 1); }else{ return $this->fail('尊敬的工程师,你好,因相关法律法规要求,空调加氟涉高作业,需要持有高处作业证书,如您想开启相关类目,请前往上传证书配置。谢谢合作!'); } } return $this->success('', [], 1, 1); } /** * @notes 工程师质保金缴费二维码 * @return \think\response\Json */ public function retentionMoneyOrder() { $openid = request()->get('openid'); if ($openid) { $worker_id = MasterWorkerRegister::where(['openid' => $openid])->value('worker_id'); } else{ return $this->success('', [], 1, 1); } $masterWorkerLogic = new \app\adminapi\logic\master_worker\MasterWorkerLogic; $result = $masterWorkerLogic::retentionMoneyOrder(['worker_id' => $worker_id], 1); if (false === $result) { return $this->fail($masterWorkerLogic::getError()); } return $this->success('', $result, 1, 1); } }