liugc 1 год назад
Родитель
Сommit
d7177da15d

+ 84 - 76
app/adminapi/lists/master_worker/BankAccountLists.php

@@ -1,77 +1,85 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeadmin快速开发前后端分离管理后台(PHP版)
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
-// | github下载:https://github.com/likeshop-github/likeadmin
-// | 访问官网:https://www.likeadmin.cn
-// | likeadmin团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeadminTeam
-// +----------------------------------------------------------------------
-
-namespace app\adminapi\lists\master_worker;
-
-
-use app\adminapi\lists\BaseAdminDataLists;
-use app\common\model\master_worker\BankAccount;
-use app\common\lists\ListsSearchInterface;
-
-
-/**
- * BankAccount列表
- * Class BankAccountLists
- * @package app\adminapi\listsmaster_worker
- */
-class BankAccountLists extends BaseAdminDataLists implements ListsSearchInterface
-{
-
-
-    /**
-     * @notes 设置搜索条件
-     * @return \string[][]
-     * @author likeadmin
-     * @date 2024/10/08 09:41
-     */
-    public function setSearch(): array
-    {
-        return [
-            '=' => ['account_holder', 'bank_name', 'province', 'city', 'opening_branch', 'account', 'mobile', 'worker_id', 'audit_state'],

-        ];
-    }
-
-
-    /**
-     * @notes 获取列表
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author likeadmin
-     * @date 2024/10/08 09:41
-     */
-    public function lists(): array
-    {
-        return BankAccount::where($this->searchWhere)
-            ->field(['id', 'account_holder', 'bank_name', 'province', 'city', 'opening_branch', 'account', 'bank_image', 'mobile', 'worker_id', 'audit_state'])
-            ->limit($this->limitOffset, $this->limitLength)
-            ->order(['id' => 'desc'])
-            ->select()
-            ->toArray();
-    }
-
-
-    /**
-     * @notes 获取数量
-     * @return int
-     * @author likeadmin
-     * @date 2024/10/08 09:41
-     */
-    public function count(): int
-    {
-        return BankAccount::where($this->searchWhere)->count();
-    }
-
+<?php
+// +----------------------------------------------------------------------
+// | likeadmin快速开发前后端分离管理后台(PHP版)
+// +----------------------------------------------------------------------
+// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
+// | 开源版本可自由商用,可去除界面版权logo
+// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
+// | github下载:https://github.com/likeshop-github/likeadmin
+// | 访问官网:https://www.likeadmin.cn
+// | likeadmin团队 版权所有 拥有最终解释权
+// +----------------------------------------------------------------------
+// | author: likeadminTeam
+// +----------------------------------------------------------------------
+
+namespace app\adminapi\lists\master_worker;
+
+
+use app\adminapi\lists\BaseAdminDataLists;
+use app\common\model\master_worker\BankAccount;
+use app\common\lists\ListsSearchInterface;
+
+
+/**
+ * BankAccount列表
+ * Class BankAccountLists
+ * @package app\adminapi\listsmaster_worker
+ */
+class BankAccountLists extends BaseAdminDataLists implements ListsSearchInterface
+{
+
+
+    /**
+     * @notes 设置搜索条件
+     * @return \string[][]
+     * @author likeadmin
+     * @date 2024/10/08 09:41
+     */
+    public function setSearch(): array
+    {
+        return [
+            '=' => ['account_holder', 'bank_name', 'province', 'city', 'opening_branch', 'account', 'mobile', 'worker_id', 'audit_state'],
+
+        ];
+    }
+
+    public function queryWhere(){
+        $where = [];
+        if(isset($this->params['range_update_time']) && !empty($this->params['range_update_time'])){
+            $time = [strtotime($this->params['range_update_time'][0]), strtotime($this->params['range_update_time'][1])];
+            $where[] = ['update_time', 'between', $time];
+        }
+        return $where;
+    }
+    /**
+     * @notes 获取列表
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author likeadmin
+     * @date 2024/10/08 09:41
+     */
+    public function lists(): array
+    {
+        return BankAccount::where($this->searchWhere)->where($this->queryWhere())
+            ->field(['id', 'account_holder', 'bank_name', 'province', 'city', 'opening_branch', 'account', 'bank_image', 'mobile', 'worker_id', 'audit_state','update_time'])
+            ->limit($this->limitOffset, $this->limitLength)
+            ->order(['id' => 'desc'])
+            ->select()
+            ->toArray();
+    }
+
+
+    /**
+     * @notes 获取数量
+     * @return int
+     * @author likeadmin
+     * @date 2024/10/08 09:41
+     */
+    public function count(): int
+    {
+        return BankAccount::where($this->searchWhere)->where($this->queryWhere())->count();
+    }
+
 }

+ 11 - 4
app/adminapi/lists/master_worker/MasterWorkerAgreeLists.php

@@ -42,7 +42,14 @@ class MasterWorkerAgreeLists extends BaseAdminDataLists implements ListsSearchIn
 
         ];
     }
-
+    public function queryWhere(){
+        $where = [];
+        if(isset($this->params['range_update_time']) && !empty($this->params['range_update_time'])){
+            $time = [strtotime($this->params['range_update_time'][0]), strtotime($this->params['range_update_time'][1])];
+            $where[] = ['update_time', 'between', $time];
+        }
+        return $where;
+    }
 
     /**
      * @notes 获取列表
@@ -55,8 +62,8 @@ class MasterWorkerAgreeLists extends BaseAdminDataLists implements ListsSearchIn
      */
     public function lists(): array
     {
-        return MasterWorkerAgree::with(['masterWorkerInfo'])->where($this->searchWhere)
-            ->field(['id', 'agree_type', 'worker_id', 'sign', 'pdf_url', 'create_time', 'audit_state'])
+        return MasterWorkerAgree::with(['masterWorkerInfo'])->where($this->searchWhere)->where($this->queryWhere())
+            ->field(['id', 'agree_type', 'worker_id', 'sign', 'pdf_url', 'create_time', 'audit_state','update_time'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()
@@ -72,7 +79,7 @@ class MasterWorkerAgreeLists extends BaseAdminDataLists implements ListsSearchIn
      */
     public function count(): int
     {
-        return MasterWorkerAgree::where($this->searchWhere)->count();
+        return MasterWorkerAgree::where($this->searchWhere)->where($this->queryWhere())->count();
     }
 
 }

+ 84 - 76
app/adminapi/lists/master_worker/MasterWorkerInfoLists.php

@@ -1,77 +1,85 @@
-<?php
-// +----------------------------------------------------------------------
-// | likeadmin快速开发前后端分离管理后台(PHP版)
-// +----------------------------------------------------------------------
-// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
-// | 开源版本可自由商用,可去除界面版权logo
-// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
-// | github下载:https://github.com/likeshop-github/likeadmin
-// | 访问官网:https://www.likeadmin.cn
-// | likeadmin团队 版权所有 拥有最终解释权
-// +----------------------------------------------------------------------
-// | author: likeadminTeam
-// +----------------------------------------------------------------------
-
-namespace app\adminapi\lists\master_worker;
-
-
-use app\adminapi\lists\BaseAdminDataLists;
-use app\common\model\master_worker\MasterWorkerInfo;
-use app\common\lists\ListsSearchInterface;
-
-
-/**
- * MasterWorkerInfo列表
- * Class MasterWorkerInfoLists
- * @package app\adminapi\listsmaster_worker
- */
-class MasterWorkerInfoLists extends BaseAdminDataLists implements ListsSearchInterface
-{
-
-
-    /**
-     * @notes 设置搜索条件
-     * @return \string[][]
-     * @author likeadmin
-     * @date 2024/10/07 18:58
-     */
-    public function setSearch(): array
-    {
-        return [
-            '=' => ['worker_id', 'real_name', 'id_card', 'mobile', 'address', 'audit_state', 'create_time'],

-        ];
-    }
-
-
-    /**
-     * @notes 获取列表
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author likeadmin
-     * @date 2024/10/07 18:58
-     */
-    public function lists(): array
-    {
-        return MasterWorkerInfo::where($this->searchWhere)
-            ->field(['id', 'worker_id', 'real_name', 'id_card', 'id_card_front_img', 'id_card_opposite_img', 'mobile', 'address', 'audit_state', 'create_time'])
-            ->limit($this->limitOffset, $this->limitLength)
-            ->order(['id' => 'desc'])
-            ->select()
-            ->toArray();
-    }
-
-
-    /**
-     * @notes 获取数量
-     * @return int
-     * @author likeadmin
-     * @date 2024/10/07 18:58
-     */
-    public function count(): int
-    {
-        return MasterWorkerInfo::where($this->searchWhere)->count();
-    }
-
+<?php
+// +----------------------------------------------------------------------
+// | likeadmin快速开发前后端分离管理后台(PHP版)
+// +----------------------------------------------------------------------
+// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
+// | 开源版本可自由商用,可去除界面版权logo
+// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
+// | github下载:https://github.com/likeshop-github/likeadmin
+// | 访问官网:https://www.likeadmin.cn
+// | likeadmin团队 版权所有 拥有最终解释权
+// +----------------------------------------------------------------------
+// | author: likeadminTeam
+// +----------------------------------------------------------------------
+
+namespace app\adminapi\lists\master_worker;
+
+
+use app\adminapi\lists\BaseAdminDataLists;
+use app\common\model\master_worker\MasterWorkerInfo;
+use app\common\lists\ListsSearchInterface;
+
+
+/**
+ * MasterWorkerInfo列表
+ * Class MasterWorkerInfoLists
+ * @package app\adminapi\listsmaster_worker
+ */
+class MasterWorkerInfoLists extends BaseAdminDataLists implements ListsSearchInterface
+{
+
+
+    /**
+     * @notes 设置搜索条件
+     * @return \string[][]
+     * @author likeadmin
+     * @date 2024/10/07 18:58
+     */
+    public function setSearch(): array
+    {
+        return [
+            '=' => ['worker_id', 'real_name', 'id_card', 'mobile', 'address', 'audit_state', 'create_time'],
+
+        ];
+    }
+    public function queryWhere(){
+        $where = [];
+        if(isset($this->params['range_update_time']) && !empty($this->params['range_update_time'])){
+            $time = [strtotime($this->params['range_update_time'][0]), strtotime($this->params['range_update_time'][1])];
+            $where[] = ['update_time', 'between', $time];
+        }
+        return $where;
+    }
+
+    /**
+     * @notes 获取列表
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author likeadmin
+     * @date 2024/10/07 18:58
+     */
+    public function lists(): array
+    {
+        return MasterWorkerInfo::where($this->searchWhere)->where($this->queryWhere())
+            ->field(['id', 'worker_id', 'real_name', 'id_card', 'id_card_front_img', 'id_card_opposite_img', 'mobile', 'address', 'audit_state', 'create_time','update_time'])
+            ->limit($this->limitOffset, $this->limitLength)
+            ->order(['id' => 'desc'])
+            ->select()
+            ->toArray();
+    }
+
+
+    /**
+     * @notes 获取数量
+     * @return int
+     * @author likeadmin
+     * @date 2024/10/07 18:58
+     */
+    public function count(): int
+    {
+        return MasterWorkerInfo::where($this->searchWhere)->where($this->queryWhere())->count();
+    }
+
 }

+ 13 - 5
app/adminapi/lists/master_worker_register/MasterWorkerRegisterLists.php

@@ -38,12 +38,20 @@ class MasterWorkerRegisterLists extends BaseAdminDataLists implements ListsSearc
     public function setSearch(): array
     {
         return [
-            '=' => ['maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'status','is_credential','age'],
+            '=' => ['maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'status','is_credential'],
             '%like%' => ['name', 'mobile'],
+            '<=' => ['age'],
         ];
     }
 
-
+    public function queryWhere(){
+        $where = [];
+        if(isset($this->params['range_update_time']) && !empty($this->params['range_update_time'])){
+            $time = [strtotime($this->params['range_update_time'][0]), strtotime($this->params['range_update_time'][1])];
+            $where[] = ['update_time', 'between', $time];
+        }
+        return $where;
+    }
     /**
      * @notes 获取列表
      * @return array
@@ -55,8 +63,8 @@ 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','credential_images'])
+        return MasterWorkerRegister::where($this->searchWhere)->where($this->queryWhere())
+            ->field(['id', 'maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'name', 'age', 'mobile', 'status','is_credential','credential_name','lat','lon','credential_images','update_time'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()
@@ -72,7 +80,7 @@ class MasterWorkerRegisterLists extends BaseAdminDataLists implements ListsSearc
      */
     public function count(): int
     {
-        return MasterWorkerRegister::where($this->searchWhere)->count();
+        return MasterWorkerRegister::where($this->searchWhere)->where($this->queryWhere())->count();
     }
 
 }

+ 1 - 1
app/adminapi/lists/works/IssueWorkLists.php

@@ -84,7 +84,7 @@ class IssueWorkLists extends BaseAdminDataLists implements ListsSearchInterface
                 },'user'=>function(Query $query){
                     $query->field('id,sn,real_name,mobile,account');
                 },'serviceWork'=>function(Query $query){
-                    $query->field('id,title,work_sn');
+                    $query->field('id,title,work_sn,address');
                 },'returnWork'=>function(Query $query){
                     $query->field('id,work_sn,finished_images');
                 }

+ 1 - 1
app/adminapi/lists/works/ServiceWorkLists.php

@@ -99,7 +99,7 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
     {
         return ServiceWork::with([
             'worker'=>function(Query $query) {
-                $query->field("id,worker_number,real_name");
+                $query->field("id,worker_number,real_name,mobile");
             },
             'goodsCategory' =>function (Query $query) {
                 $query->field('id,name');

+ 1 - 1
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -371,7 +371,7 @@ class ServiceWorkLogic extends BaseLogic
     public static function detail($params){
         $result = ServiceWork::with([
             'worker'=> function(Query $query) {
-                $query->field('id,worker_number,real_name');
+                $query->field('id,worker_number,real_name,mobile');
             },
             'allocateWorkerLog' =>function(Query $query){
                 $query->field('id,work_id,opera_log,create_time');

+ 4 - 1
app/common/model/works/ServiceWork.php

@@ -149,7 +149,10 @@ class ServiceWork extends BaseModel
         }
         return $status[$data['service_status']];
     }
-
+    public function getDispatchTimeAttr($value,$data)
+    {
+        return !empty($data['dispatch_time'])?date('Y/m/d H:i:s',$data['dispatch_time']):'';
+    }
     public function getAppointmentTimeAttr($value,$data)
     {
         return !empty($data['appointment_time'])?date('Y/m/d H:i:s',$data['appointment_time']):'';