|
|
@@ -18,7 +18,6 @@ namespace app\adminapi\lists\works;
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
|
use app\common\model\goods_category\GoodsCategory;
|
|
|
use app\common\model\master_worker\MasterWorker;
|
|
|
-use app\common\model\property\PropertyOrder;
|
|
|
use app\common\model\works\ServiceWork;
|
|
|
use app\common\lists\ListsSearchInterface;
|
|
|
use think\db\Query;
|
|
|
@@ -33,34 +32,7 @@ use think\facade\Log;
|
|
|
class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
{
|
|
|
|
|
|
- /**
|
|
|
- * 获取数据权限
|
|
|
- * $this->adminInfo['data_rules']
|
|
|
- * province city admin_id sale_group_id sale_id property_head_id
|
|
|
- */
|
|
|
- public function queryDataWhere(){
|
|
|
- $where = [];
|
|
|
- $data_rules = $this->adminInfo['data_rules'];
|
|
|
- if (isset($data_rules['province']) && !empty($data_rules['province'])) {
|
|
|
- $where[] = ['province','in' ,$data_rules['province']];
|
|
|
- }
|
|
|
- if (isset($data_rules['city']) && !empty($data_rules['city'])) {
|
|
|
- $where[] = ['city','in' ,$data_rules['city']];
|
|
|
- }
|
|
|
- if (isset($data_rules['sale_group_id']) && !empty($data_rules['sale_group_id'])) {
|
|
|
- $work_ids = PropertyOrder::where('sale_group_id','in',$data_rules['sale_group_id'])->column('work_id')??[];
|
|
|
- $where[] = ['id','in' ,$work_ids];
|
|
|
- }
|
|
|
- if (isset($data_rules['sale_id']) && !empty($data_rules['sale_id'])) {
|
|
|
- $work_ids = PropertyOrder::where('sale_id','in',$data_rules['sale_id'])->column('work_id')??[];
|
|
|
- $where[] = ['id','in' ,$work_ids];
|
|
|
- }
|
|
|
- if (isset($data_rules['property_head_id']) && !empty($data_rules['property_head_id'])) {
|
|
|
- $work_ids = PropertyOrder::where('property_head_id','in',$data_rules['property_head_id'])->column('work_id')??[];
|
|
|
- $where[] = ['id','in' ,$work_ids];
|
|
|
- }
|
|
|
- return $where;
|
|
|
- }
|
|
|
+
|
|
|
/**
|
|
|
* @notes 设置搜索条件
|
|
|
* @return \string[][]
|
|
|
@@ -136,6 +108,10 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|
|
}else{
|
|
|
$where[] = ['work_pay_status','=',$this->params['work_pay_status']];
|
|
|
}
|
|
|
+
|
|
|
+ if(isset($this->params['property_activity_id']) && !empty($this->params['property_activity_id'])){
|
|
|
+ $where[] = ['property_activity_id','>',0];
|
|
|
+ }
|
|
|
return $where;
|
|
|
}
|
|
|
/**
|
|
|
@@ -168,8 +144,7 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|
|
])
|
|
|
->where($this->searchWhere)
|
|
|
->where($this->queryWhere())
|
|
|
- ->where($this->queryDataWhere())
|
|
|
- ->field(['id', 'work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'goods_category_ids', 'goods_category_id', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status', 'dispatch_time', 'receive_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'work_amount', 'work_type', 'create_time', 'update_time','lon', 'lat','appoint_approval','refund_approval','finally_door_time'])
|
|
|
+ ->field(['id', 'work_sn', 'real_name', 'mobile', 'address', 'title', 'category_type', 'goods_category_ids', 'goods_category_id', 'base_service_fee', 'service_fee', 'work_status','work_pay_status', 'service_status', 'dispatch_time', 'receive_time', 'appointment_time', 'finished_images', 'finished_time', 'master_worker_id', 'work_amount', 'work_type', 'create_time', 'update_time','lon', 'lat','appoint_approval','refund_approval','finally_door_time','property_activity_id'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['id' => 'desc'])
|
|
|
->select()
|
|
|
@@ -185,7 +160,7 @@ class ServiceWorkLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|
|
*/
|
|
|
public function count(): int
|
|
|
{
|
|
|
- return ServiceWork::where($this->searchWhere)->where($this->queryWhere())->where($this->queryDataWhere())->count();
|
|
|
+ return ServiceWork::where($this->searchWhere)->where($this->queryWhere())->count();
|
|
|
}
|
|
|
|
|
|
}
|