Browse Source

工程师基本信息接口

whitefang 1 year ago
parent
commit
3fe297009a
1 changed files with 14 additions and 0 deletions
  1. 14 0
      app/workerapi/logic/MasterWorkerLogic.php

+ 14 - 0
app/workerapi/logic/MasterWorkerLogic.php

@@ -6,6 +6,7 @@ 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\MasterWorkerAgree;
 use app\common\model\master_worker\MasterWorkerInfo;
 use app\common\model\works\ServiceWork;
 use app\common\service\FileService;
@@ -122,6 +123,19 @@ class MasterWorkerLogic extends  BaseLogic
             ->findOrEmpty($userId)
             ->toArray();
 
+        //验证是否上传身份证
+        $is_id_card = MasterWorkerInfo::where('worker_id',$userId)->whereIn('audit_state','0,1')->findOrEmpty()->toArray();
+
+        //判断是否填写银行信息
+        $is_bank = BankAccount::where('worker_id',$userId)->whereIn('audit_state','0,1')->findOrEmpty()->toArray();
+
+        //监测是否签署服务合作协议
+        $pdf = MasterWorkerAgree::where(['agree_type'=>'master_service_content','worker_id'=>$userId])->whereIn('audit_state','0,1')->value('pdf_url');
+
+        $worker['is_id_card'] = !empty($is_id_card)?1:0;
+        $worker['is_bank']  =   !empty($is_bank)?1:0;
+        $worker['is_service_agree'] = !empty($pdf)?1:0;
+
         //今日收益
         $worker['account_today'] = MasterWorkerAccountLog::where(['worker_id'=> $worker['id'],'action'=>1,'change_type'=>WorkerAccountLogEnum::UM_INC_ADMIN])->whereTime('create_time', 'today')->sum('change_amount');
         //本月成功订单