Commit 57e06830 by 汪伟伟

未完成已完成 搜索

parent e40384a5
...@@ -127,15 +127,15 @@ class AlreadyDoneTaskController extends AdminController ...@@ -127,15 +127,15 @@ class AlreadyDoneTaskController extends AdminController
$param = request()->input(); $param = request()->input();
return Grid::make(\App\Models\Tas::with(['receives'=>fn($q)=>$q->where('status','>',0) return Grid::make(\App\Models\Tas::with(['receives'=>fn($q)=>$q->where('status','>',0)
,'receives.task'=>fn($q)=>$q->where(function ($que)use($param){ ->whereHas('task',function ($query)use($param){
if (!empty($param['receives']['task']['name'])){ if (!empty($param['receives']['task']['name'])){
$que->where('name','like',"%{$param['receives']['task']['name']}%"); $query->where('name','like',"%{$param['receives']['task']['name']}%");
} }
if (!empty($param['receives']['task']['city_id'])){ if (!empty($param['receives']['task']['city_id'])){
$que->where('city_id','like',"%{$param['receives']['task']['city_id']}%"); $query->where('city_id','like',"%{$param['receives']['task']['city_id']}%");
} }
if (!empty($param['receives']['task']['year'])){ if (!empty($param['receives']['task']['year'])){
$que->where('year','like',"%{$param['receives']['task']['year']}%"); $query->where('year','like',"%{$param['receives']['task']['year']}%");
} }
}) })
,'receives.user','receives.collects','receives.approve'])->whereHas('receives',function ($query){ ,'receives.user','receives.collects','receives.approve'])->whereHas('receives',function ($query){
......
...@@ -113,15 +113,15 @@ class NoDoneTaskController extends AdminController ...@@ -113,15 +113,15 @@ class NoDoneTaskController extends AdminController
$param = request()->input(); $param = request()->input();
return Grid::make(\App\Models\Tas::with(['receives'=>fn($q)=>$q->where('status',0) return Grid::make(\App\Models\Tas::with(['receives'=>fn($q)=>$q->where('status',0)
,'receives.task'=>fn($q)=>$q->where(function ($que)use($param){ ->whereHas('task',function ($query)use($param){
if (!empty($param['receives']['task']['name'])){ if (!empty($param['receives']['task']['name'])){
$que->where('name','like',"%{$param['receives']['task']['name']}%"); $query->where('name','like',"%{$param['receives']['task']['name']}%");
} }
if (!empty($param['receives']['task']['city_id'])){ if (!empty($param['receives']['task']['city_id'])){
$que->where('city_id','like',"%{$param['receives']['task']['city_id']}%"); $query->where('city_id','like',"%{$param['receives']['task']['city_id']}%");
} }
if (!empty($param['receives']['task']['year'])){ if (!empty($param['receives']['task']['year'])){
$que->where('year','like',"%{$param['receives']['task']['year']}%"); $query->where('year','like',"%{$param['receives']['task']['year']}%");
} }
}) })
,'receives.user' ,'receives.user'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment