Sfoglia il codice sorgente

图片/查询/提留限制

liugc 1 anno fa
parent
commit
7c68228a24

+ 2 - 4
app/adminapi/lists/master_worker_register/MasterWorkerRegisterLists.php

@@ -38,10 +38,8 @@ class MasterWorkerRegisterLists extends BaseAdminDataLists implements ListsSearc
     public function setSearch(): array
     {
         return [
-            '=' => ['maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'status','is_credential'],
+            '=' => ['maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'status','is_credential','age'],
             '%like%' => ['name', 'mobile'],
-            'between' => ['age'],
-
         ];
     }
 
@@ -58,7 +56,7 @@ class MasterWorkerRegisterLists extends BaseAdminDataLists implements ListsSearc
     public function lists(): array
     {
         return MasterWorkerRegister::where($this->searchWhere)
-            ->field(['id', 'maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'name', 'age', 'mobile', 'status','is_credential','credential_name','lat','lon'])
+            ->field(['id', 'maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'name', 'age', 'mobile', 'status','is_credential','credential_name','lat','lon','credential_images'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()

+ 2 - 0
app/adminapi/lists/works/IssueWorkLists.php

@@ -85,6 +85,8 @@ class IssueWorkLists extends BaseAdminDataLists implements ListsSearchInterface
                     $query->field('id,sn,real_name,mobile,account');
                 },'serviceWork'=>function(Query $query){
                     $query->field('id,title,work_sn');
+                },'returnWork'=>function(Query $query){
+                    $query->field('id,work_sn,finished_images');
                 }
             ])
             ->where($this->searchWhere)

+ 24 - 0
app/adminapi/logic/goods/GoodsLogic.php

@@ -132,6 +132,18 @@ class GoodsLogic extends BaseLogic
             ]);
 
             //更新绩效规则
+            if(in_array($params['type'],[0,1,2])){
+                // 0-1
+                if($params['rate']>1){
+                    throw new Exception('商品绩效比率不能大于1');
+                }
+            }
+            if(in_array($params['type'],[3])){
+                // ≥1
+                if($params['rate']<1){
+                    throw new Exception('金额不能小于1');
+                }
+            }
             $rule = PerformanceRules::where(['goods_id'=>$params['id']])->findOrEmpty();
             if(!$rule->isEmpty()){
                 $rule->type = $params['type'];
@@ -185,6 +197,18 @@ class GoodsLogic extends BaseLogic
     {
         Db::startTrans();
         try {
+            if(in_array($params['type'],[0,1,2])){
+                // 0-1
+                if($params['rate']>1){
+                    throw new Exception('商品绩效比率不能大于1');
+                }
+            }
+            if(in_array($params['type'],[3])){
+                // ≥1
+                if($params['rate']<1){
+                    throw new Exception('金额不能小于1');
+                }
+            }
             foreach ($params['ids'] as $id){
                 $rule = null;
                 //更新绩效规则

+ 4 - 1
app/common/model/master_worker/BankAccount.php

@@ -29,6 +29,9 @@ class BankAccount extends BaseModel
 //    use SoftDelete;
     protected $name = 'bank_account';
 //    protected $deleteTime = 'delete_time';
+    public function getBankImageAttr($value)
+    {
+        return empty($value)?'':json_decode(json_encode([$value]),true);
+    }
 
-    
 }

+ 4 - 1
app/common/model/master_worker_register/MasterWorkerRegister.php

@@ -28,7 +28,10 @@ class MasterWorkerRegister extends BaseModel
 {
     
     protected $name = 'master_worker_register';
-    
 
+    public function getCredentialImagesAttr($value)
+    {
+        return empty($value)?'':json_decode($value,true);
+    }
     
 }

+ 8 - 1
app/common/model/works/IssueWork.php

@@ -43,6 +43,10 @@ class IssueWork extends BaseModel
     {
         return $this->hasOne(ServiceWork::class,'id','service_work_id');
     }
+    public function returnWork()
+    {
+        return $this->hasOne(ReturnWork::class,'work_sn','work_sn');
+    }
     public function admin()
     {
         return $this->hasOne(Admin::class,'id','approval_admin_id');
@@ -52,7 +56,10 @@ class IssueWork extends BaseModel
         $approval = [0=>'等待受理',1=>'受理中',2=>'已核实',3=>'返修中',4=>'已完结'];
         return $approval[$data['issue_approval']];
     }
-
+    public function getFinishedImagesAttr($value)
+    {
+        return empty($value)?'':json_decode($value,true);
+    }
     public function getComplaintImagesAttr($value)
     {
         return empty($value)?'':json_decode($value,true);

+ 1 - 0
app/workerapi/logic/LoginLogic.php

@@ -59,6 +59,7 @@ class LoginLogic extends BaseLogic
                 'vehicle_type' => $params['vehicle_type'],
                 'name' => $params['name'],
                 'age' => $params['age'],
+                'sex' => $params['sex']??0,
                 'mobile' => $params['mobile'],
                 'is_credential' => !empty($params['is_credential'])?$params['is_credential']:0,
                 'credential_name' => !empty($params['credential_name'])?$params['credential_name']:'',