From 03433f4a5dbfba19aaa4658acbe0a4488a342fe0 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 20 Nov 2023 11:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Common.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 0c080fa..b4af0d4 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -619,16 +619,25 @@ class Common extends ApiController $flows = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'delete_time'=>0])->order('sort asc')->select()->toArray(); if ($type == 1) { $detail = Db::name('Approve')->where('id',$param['id'])->find(); + if (empty($detail)) { + $this->apiError("审批流程不存在"); + } $create_user_id = $detail['admin_id']; $create_user= Db::name('Admin')->where('id',$detail['admin_id'])->value('name'); } if ($type == 2) { $detail = Db::name('Expense')->where('id',$param['id'])->find(); + if (empty($detail)) { + $this->apiError("审批流程不存在"); + } $create_user_id = $detail['admin_id']; $create_user = Db::name('Admin')->where('id',$detail['admin_id'])->value('name'); } if ($type == 3) { $detail = Db::name('Invoice')->where('id',$param['id'])->find(); + if (empty($detail)) { + $this->apiError("审批流程不存在"); + } $create_user_id = $detail['admin_id']; $create_user = Db::name('Admin')->where('id',$detail['admin_id'])->value('name'); }