From d3e9f113ba0efe47b5c1854cddca81eb7c7b55f6 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 13 Jan 2021 13:52:00 +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 --- .../Controller/ExportController.class.php | 6 +++ .../MarketPercentageController.class.php | 14 ++++-- .../Controller/TimingController.class.php | 10 +++++ .../Admin/Controller/UserController.class.php | 11 +++-- Application/Admin/View/User/edit.html | 4 +- Application/Admin/View/User/index.html | 5 +++ .../Base/Factory/BaseFactory.class.php | 45 +++++++++++++++++++ 7 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 Application/Base/Factory/BaseFactory.class.php diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 39cce7e7b..ea63a7dae 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5654,6 +5654,7 @@ class ExportController extends Controller $xlsCell = array( array('uid','账号ID'), array('nickname','管理员账号'), + array('real_name','真实姓名'), array('group_name','角色类型'), array('login','登录次数'), array('last_login_time','最后登录时间'), @@ -5666,6 +5667,11 @@ class ExportController extends Controller }else{ $map['nickname'] = array('like', '%'.(string)$nickname.'%'); } + + if(isset($_REQUEST['real_name'])) { + $map['real_name'] = $_REQUEST['real_name']; + } + if(isset($_REQUEST['status'])){ $map['status'] = $_REQUEST['status']; } diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 721ec26fc..2c4d69bcf 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -3,7 +3,7 @@ namespace Admin\Controller; use User\Api\UserApi as UserApi; -use Base\Service\LeavePercentageService; +use Base\Factory\BaseFactory; /** * 后台首页控制器 @@ -13,7 +13,8 @@ class MarketPercentageController extends ThinkController { protected $coefficient = []; - private $leavePercentage ; + //实例化离职服务类 + private $leavePercentage; protected function _initialize() { @@ -25,7 +26,11 @@ class MarketPercentageController extends ThinkController $this->coefficient[$value['pay_time']][$value['admin_id']] = $value['coefficient'] / 100; } - LeavePercentageService::unSettlementList(); + + $instance = BaseFactory::getInstance(); + $this->leavePercentage = $instance->factoryClass("LeavePercentage"); + //不结算列表 + $this->leavePercentage->unSettlementList(); parent::_initialize(); } @@ -741,6 +746,9 @@ class MarketPercentageController extends ThinkController continue; } } +// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id'])); + //离职结算判断 + !($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?$data[$key]['achievement_bonus']=0:''; $data[$key]['start_time'] = date("Y-m-1", strtotime($value['pay_time'])); $data[$key]['end_time'] = date("Y-m-t", strtotime($value['pay_time'])); diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 5f50f2acc..b500187f7 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -10,6 +10,7 @@ namespace Admin\Controller; use User\Api\UserApi as UserApi; use function GuzzleHttp\Psr7\str; +use Base\Factory\BaseFactory; /** * 后台首页控制器 @@ -1545,4 +1546,13 @@ class TimingController extends AdminController { } + //离职定时器 + public function timingleaveMarketMember() { + + $instance = BaseFactory::getInstance(); + $leavePercentageInstance = $instance->factoryClass("LeavePercentage"); + + $leavePercentageInstance->leaveTiming(); + } + } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 0a2534758..c935e31fa 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -31,6 +31,11 @@ class UserController extends AdminController if (isset($_REQUEST['status'])) { $map['status'] = $_REQUEST['status']; } + + if(isset($_REQUEST['real_name'])) { + $map['real_name'] = $_REQUEST['real_name']; + } + if (is_numeric($nickname)) { $map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true); } else { @@ -447,7 +452,7 @@ class UserController extends AdminController $info['email'] = $_POST['email']; $info['mobile'] = isset($_POST['mobile']) ? $_POST['mobile'] : ''; $_POST['apply_leave_time'] ? ($info['apply_leave_time'] = strtotime($_POST['apply_leave_time'])):''; - $_POST['leave_time'] ? ($info['leave_time'] = strtotime($_POST['leave_time'])):''; + $_POST['leave_time'] ? ($info['leave_time'] = strtotime($_POST['leave_time'])+86399):''; if($_POST['work_status']) { $info['work_status'] = $_POST['work_status']; } @@ -481,8 +486,8 @@ class UserController extends AdminController $map['id'] = $_GET['id']; $Member = D('UcenterMember')->where($map)->find(); - $Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time']); - $Member['leave_time'] = date("Y-m-d",$Member['leave_time']); + $Member['apply_leave_time']?($Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time'])):($Member['apply_leave_time']=''); + $Member['leave_time']?($Member['leave_time'] = date("Y-m-d",$Member['leave_time'])):($Member['leave_time']=''); $data = D('Member')->where(array('uid' => $_GET['id']))->find(); diff --git a/Application/Admin/View/User/edit.html b/Application/Admin/View/User/edit.html index 0c2789fee..1aa028c6a 100644 --- a/Application/Admin/View/User/edit.html +++ b/Application/Admin/View/User/edit.html @@ -85,10 +85,10 @@ diff --git a/Application/Admin/View/User/index.html b/Application/Admin/View/User/index.html index b1c464739..95de51dba 100644 --- a/Application/Admin/View/User/index.html +++ b/Application/Admin/View/User/index.html @@ -22,6 +22,9 @@
+
+ +