Merge pull request '1.28功能提交' (#127) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/127
master
郑永星 4 years ago
commit 3d09dcf4b5

@ -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;
}

Loading…
Cancel
Save