From 6e767a739c3cfdff42da36c7939321d713e9e34f Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 12 Jan 2021 18:23:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=9A=E7=BB=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketPercentageController.class.php | 26 ++++--- .../Admin/Controller/UserController.class.php | 21 +++++ Application/Admin/View/User/edit.html | 42 +++++++++- .../Service/LeavePercentageService.class.php | 77 +++++++++++++++++++ Data/update.sql | 6 +- 5 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 Application/Base/Service/LeavePercentageService.class.php diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 77f8e064d..721ec26fc 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -3,6 +3,7 @@ namespace Admin\Controller; use User\Api\UserApi as UserApi; +use Base\Service\LeavePercentageService; /** * 后台首页控制器 @@ -12,6 +13,7 @@ class MarketPercentageController extends ThinkController { protected $coefficient = []; + private $leavePercentage ; protected function _initialize() { @@ -23,6 +25,8 @@ class MarketPercentageController extends ThinkController $this->coefficient[$value['pay_time']][$value['admin_id']] = $value['coefficient'] / 100; } + LeavePercentageService::unSettlementList(); + parent::_initialize(); } @@ -582,28 +586,28 @@ class MarketPercentageController extends ThinkController if (is_administrator() || session('user_group_id') == 15 || session('user_group_id') == 14 || session('user_group_id') == 19 || session('user_group_id') == 23) { unset($map['admin_id']); - $markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select(); - - if ($markerData) { - $admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')]; - } +// $markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select(); +// +// if ($markerData) { +// $admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')]; +// } $admin_data = M("member") ->field("access.uid admin_id") ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") ->join("left join sys_auth_group auth on access.group_id=auth.id") ->where(['group_id' => ['in', '11,12,21']]) - ->where($admin_map) +// ->where($admin_map) ->select(); if ($admin_data) { $map['admin_id'] = ['in', array_column($admin_data, 'admin_id')]; } - if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) { +// if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) { $_REQUEST['admin_id'] ? ($map['admin_id'] = $_REQUEST['admin_id']) : ''; - } else { - $this->display("marketstaffsettle"); - die(); - } +// } else { +// $this->display("marketstaffsettle"); +// die(); +// } } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 6d3013b5f..0a2534758 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -389,6 +389,22 @@ class UserController extends AdminController } } + if (strtotime($_POST['apply_leave_time'])error('申请离职时间不能早于当前时间!'); + } + + if (strtotime($_POST['leave_time'])error('离职时间不能早于当前时间!'); + } + + if (strtotime($_POST['apply_leave_time'])>strtotime($_POST['leave_time'])) { + $this->error('申请离职时间不得晚于离职时间!'); + } + + if ((strtotime($_POST['apply_leave_time'])&&!strtotime($_POST['leave_time']))||!strtotime($_POST['apply_leave_time'])&&strtotime($_POST['leave_time'])) { + $this->error('申请离职时,申请离职时间与离职时间都必须填写!'); + } + $group = M('auth_group', 'sys_')->where(['id' => I('auth')])->find(); if (is_null($group)) { $this->error('角色类型不存在!'); @@ -430,6 +446,8 @@ class UserController extends AdminController $info['second_pwd'] = (empty($spwd) || $spwd == $oldspwd) ? $oldspwd : $spwd; $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'])):''; if($_POST['work_status']) { $info['work_status'] = $_POST['work_status']; } @@ -463,6 +481,9 @@ 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']); + $data = D('Member')->where(array('uid' => $_GET['id']))->find(); $au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find(); diff --git a/Application/Admin/View/User/edit.html b/Application/Admin/View/User/edit.html index 84f1118de..0c2789fee 100644 --- a/Application/Admin/View/User/edit.html +++ b/Application/Admin/View/User/edit.html @@ -68,6 +68,18 @@ + + 申请离职时间: + + + + + + 离职时间: + + + + 离职状态 @@ -78,7 +90,7 @@ - 离职状态,市场专员离职发放后自动标志未离职 + @@ -119,6 +131,11 @@ + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + +
@@ -134,6 +151,29 @@