|
|
@@ -3,8 +3,10 @@ namespace app\workerapi\logic;
|
|
|
use app\common\enum\worker\WorkerAccountLogEnum;
|
|
|
use app\common\enum\YesNoEnum;
|
|
|
use app\common\logic\BaseLogic;
|
|
|
+use app\common\model\bank_account\BankAccount;
|
|
|
use app\common\model\master_worker\MasterWorker;
|
|
|
use app\common\model\master_worker\MasterWorkerAccountLog;
|
|
|
+use app\common\model\master_worker\MasterWorkerInfo;
|
|
|
use app\common\model\works\ServiceWork;
|
|
|
use app\common\service\FileService;
|
|
|
use think\Exception;
|
|
|
@@ -135,12 +137,39 @@ class MasterWorkerLogic extends BaseLogic
|
|
|
if ($params['field'] == "avatar" || $params['field'] == "real_avatar") {
|
|
|
$params['value'] = FileService::setFileUrl($params['value']);
|
|
|
}
|
|
|
+
|
|
|
+ if($params['field'] == 'accept_order_status'){
|
|
|
+ //验证身份证信息是否审核通过
|
|
|
+ $idCard = MasterWorkerInfo::where(['worker_id'=>$userId])->findOrEmpty();
|
|
|
+ if ($idCard->isEmpty()) {
|
|
|
+ throw new \Exception('请先完善身份证信息',20);
|
|
|
+ }
|
|
|
+ if($idCard->audit_state == 0){
|
|
|
+ throw new \Exception('身份证信息核验中,请等待核验完成',20);
|
|
|
+ }
|
|
|
+ if($idCard->audit_state == 1){
|
|
|
+ throw new \Exception('身份证信息核验不通过,请重新填写',20);
|
|
|
+ }
|
|
|
+ //验证银行卡信息是否审核通过
|
|
|
+ $bank = BankAccount::where(['worker_id'=>$userId])->findOrEmpty();
|
|
|
+ if ($bank->isEmpty()) {
|
|
|
+ throw new \Exception('请先完善银行卡信息',21);
|
|
|
+ }
|
|
|
+ if($bank->audit_state == 0){
|
|
|
+ throw new \Exception('银行卡信息核验中,请等待核验完成',21);
|
|
|
+ }
|
|
|
+ if($bank->audit_state == 1){
|
|
|
+ throw new \Exception('银行卡信息核验不通过,请重新填写',21);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return MasterWorker::update([
|
|
|
'id' => $userId,
|
|
|
$params['field'] => $params['value']]
|
|
|
);
|
|
|
} catch (\Exception $e) {
|
|
|
self::$error = $e->getMessage();
|
|
|
+ self::$returnCode = $e->getCode();
|
|
|
return false;
|
|
|
}
|
|
|
}
|