From 1951e2333c5f3ad2e79bbc4ec2c0efd2f0433668 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 26 Feb 2026 09:26:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=AE=A1=E6=A0=B8=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/InvRequisitionService.php | 6 ++++-- app/mobile/controller/InvRequisitionController.php | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/common/service/InvRequisitionService.php b/app/common/service/InvRequisitionService.php index e509b2e..134d9eb 100644 --- a/app/common/service/InvRequisitionService.php +++ b/app/common/service/InvRequisitionService.php @@ -60,10 +60,12 @@ class InvRequisitionService $config['where']['applicant_id'] = $request->user->uid; } elseif (isset($p['applicant_id']) && $p['applicant_id']) { //指定人员的申请 $config['where']['applicant_id'] = $p['applicant_id']; - } else { //审批人对应的记录 + } + /* else { //审批人对应的记录 + $config['with'] = ['approval']; $config['where']['approval.approver_id'] = $request->user->uid; //$config['where']['approval.action'] = 0; - } + }*/ if(isset($p['phase']) && $p['phase'] == 'approve'){//借用审批中 $config['where']['status'] = ['in',[10,11]]; if(isset($p['scene']) && $p['scene'] == 'approval'){ diff --git a/app/mobile/controller/InvRequisitionController.php b/app/mobile/controller/InvRequisitionController.php index 7ee69c5..e00cb5a 100644 --- a/app/mobile/controller/InvRequisitionController.php +++ b/app/mobile/controller/InvRequisitionController.php @@ -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(),