From 338c0369d1ea89bf2c0650bd984da3a52e51a3ee Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 28 Jan 2021 15:58:49 +0800 Subject: [PATCH] =?UTF-8?q?1.28=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Factory/LeavePercentageFactory.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Application/Base/Factory/LeavePercentageFactory.class.php b/Application/Base/Factory/LeavePercentageFactory.class.php index e5cdef9a3..ac96ac7d5 100644 --- a/Application/Base/Factory/LeavePercentageFactory.class.php +++ b/Application/Base/Factory/LeavePercentageFactory.class.php @@ -7,6 +7,7 @@ class LeavePercentageFactory // private $isLeave = [0=>'']; private $model; static $arrUnSettlementList = []; + static $arrUnSettlementApplyList = []; public function __construct() { @@ -19,22 +20,26 @@ class LeavePercentageFactory */ public function unSettlementList() { - if (self::$arrUnSettlementList) { + if (self::$arrUnSettlementList||self::$arrUnSettlementApplyList) { return; } $data = $this->model ->where(['work_status'=>1])->select(); $returnData = []; + $returnApplyData = []; foreach ($data as $key => $value) { $returnData[$value['id']] = $value['leave_time']; + $returnApplyData[$value['id']] = $value['apply_leave_time']; } + self::$arrUnSettlementApplyList = $returnApplyData; self::$arrUnSettlementList = $returnData; + } public function returnUnSettlementList() { @@ -69,7 +74,7 @@ class LeavePercentageFactory //当月离职时间,在职时间小于30天不结算 if (self::$arrUnSettlementList[$admin_id] &&date("Y-m",self::$arrUnSettlementList[$admin_id])==$date - &&(strtotime(date("Y-m-t",strtotime($date)))-self::$arrUnSettlementList[$admin_id])<86400*30) { + &&(self::$arrUnSettlementList[$admin_id]-self::$arrUnSettlementApplyList[$admin_id])<86400*30) { return false; }