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]); + } }