From c9ef39ada977e22a6759aa1c0cb4dea2de5b4a3f Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 13 Jan 2021 17:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=9A=E7=BB=A9=E7=A6=BB?= =?UTF-8?q?=E8=81=8C=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ompanyStatementOfflineController.class.php | 1 + .../LeavePercentageFactory.class.php} | 38 ++++++++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) rename Application/Base/{Service/LeavePercentageService.class.php => Factory/LeavePercentageFactory.class.php} (60%) diff --git a/Application/Admin/Controller/CompanyStatementOfflineController.class.php b/Application/Admin/Controller/CompanyStatementOfflineController.class.php index d24a39167..4a01c16c3 100644 --- a/Application/Admin/Controller/CompanyStatementOfflineController.class.php +++ b/Application/Admin/Controller/CompanyStatementOfflineController.class.php @@ -67,6 +67,7 @@ class CompanyStatementOfflineController extends ThinkController ->alias("c") ->field("c.*,p.statement_num,p.verify_status") ->where($map) + ->where(['p.verify_status'=>['neq',6]]) ->join("tab_company_statement_pool as p ON c.pool_id = p.id") diff --git a/Application/Base/Service/LeavePercentageService.class.php b/Application/Base/Factory/LeavePercentageFactory.class.php similarity index 60% rename from Application/Base/Service/LeavePercentageService.class.php rename to Application/Base/Factory/LeavePercentageFactory.class.php index e9db49b7f..51f1becdb 100644 --- a/Application/Base/Service/LeavePercentageService.class.php +++ b/Application/Base/Factory/LeavePercentageFactory.class.php @@ -1,33 +1,29 @@ '']; private $model; static $arrUnSettlementList = []; - private function __construct() + public function __construct() { $this->model = M("ucenter_member"); } - static function getInstance() { - - } - /** * 不结算的管理员列表 * @return array */ public function unSettlementList() { - if (isset(self::$arrUnSettlementList)) { + if (self::$arrUnSettlementList) { return; } - $data = $this->model ->where(['work_status'=>0])->select(); + $data = $this->model ->where(['work_status'=>1])->select(); $returnData = []; @@ -41,6 +37,12 @@ class LeavePercentageService } + /** + * 判断是否结算绩效 + * @param string $date + * @param int $admin_id + * @return bool + */ public function isSettlement($date = '',$admin_id= 0) { //未离职结算 @@ -66,9 +68,27 @@ class LeavePercentageService } + /** + * 离职定时器方法 + */ public function leaveTiming() { + $memberData = $this->model->where(['leave_time'=>['gt',0],"work_status"=>0])->select(); + $where = []; + + foreach ($memberData as $key => $value) { + //判断离职时间是否已经达到 + if (time() >= $value['leave_time']) { + array_push($where,$value['id']); + } + } + //离职时间达到列表 + if($where) { + $this->model + ->where(['id'=>['in',$where]]) + ->save(['work_status'=>1]); + } }