待审核筛选
This commit is contained in:
@@ -54,10 +54,11 @@ class InvRequisitionController extends BaseController
|
||||
public function index(Request $request)
|
||||
{
|
||||
try {
|
||||
$param = $request->all();
|
||||
$applicant_id = $request->get('applicant_id');
|
||||
$raw = $this->service->serviceList($request);
|
||||
$uid = $request->user->uid;
|
||||
$data = $this->formatindex($raw,$applicant_id,$uid);
|
||||
$data = $this->formatindex($raw,$applicant_id,$uid,$param);
|
||||
// $data = $this->transformData($raw, method_exists($this, 'indexFormat')
|
||||
// ? [$this, 'indexFormat']
|
||||
// : null);
|
||||
@@ -67,11 +68,18 @@ class InvRequisitionController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function formatindex($p,$applicant_id,$uid){
|
||||
public function formatindex($p,$applicant_id,$uid,$param){
|
||||
$records = $p->getCollection()
|
||||
->map(fn($item) => $this->indexFormat($item, $applicant_id,$uid))
|
||||
->toArray();
|
||||
|
||||
if(isset($param['phase']) && $param['phase'] == 'pending'){
|
||||
foreach ($records as $key => $record) {
|
||||
if($record['action']==1 || $record['action']==2)
|
||||
unset($records[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'records' => $records,
|
||||
'total' => $p->total(),
|
||||
|
||||
Reference in New Issue
Block a user