市场业绩离职功能提交导出修正

master
zhengyongxing 4 years ago
parent 6e767a739c
commit d3e9f113ba

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

@ -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']));

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

@ -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();

@ -85,10 +85,10 @@
<td class="r table_radio table_radio2">
<span class="table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="work_status" <if condition="$list['work_status'] eq 1"> checked</if>> 离职
<input disabled type="radio" class="inp_radio" value="1" name="work_status" <if condition="$list['work_status'] eq 1"> checked</if>> 离职
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="work_status" <if condition="$list['work_status'] eq 0"> checked</if> > 未离职
<input disabled type="radio" class="inp_radio" value="0" name="work_status" <if condition="$list['work_status'] eq 0"> checked</if> > 未离职
</label></span>
<!-- <span class="notice-text" style="line-height:1.4;width:68%;">离职状态,市场专员离职发放后自动标志未离职</span>-->

@ -22,6 +22,9 @@
<div class="sleft">
<input type="text" name="nickname" class="" value="{:I('nickname')}" placeholder="管理员账号">
</div>
<div class="sleft">
<input type="text" name="real_name" class="" value="{:I('real_name')}" placeholder="真实姓名">
</div>
<div class="sleft">
<select name="status">
<option value="">状态</option>
@ -42,6 +45,7 @@
<th class="">账号ID</th>
<th class="">管理员账号</th>
<th class="">真实姓名</th>
<th class="">角色类型</th>
<th class="">登录次数</th>
<th class="">最后登录时间</th>
@ -56,6 +60,7 @@
<tr>
<td>{$vo.uid} </td>
<td>{$vo.nickname}</td>
<td>{$vo.real_name}</td>
<td>
{:get_auth_group_name($vo['uid'])}
</td>

@ -0,0 +1,45 @@
<?php
namespace Base\Factory;
use Base\Factory\LeavePercentageFactory;
class BaseFactory {
private static $instance ;
private $suffix = "Factory";
public $classes = [
'LeavePercentageFactory' => LeavePercentageFactory::class,
];
public function __construct()
{
}
//获取实例化接口
static function getInstance() {
if (!(self::$instance instanceof self)) {
self::$instance = new self();
}
return self::$instance;
}
//工厂类返回实例化类
public function factoryClass($name = '') {
if (!$name) {
return false;
}
$className = "{$name}{$this->suffix}";
if ($this->classes[$className]) {
return (new $this->classes[$className]);
} else {
return false;
}
}
}
Loading…
Cancel
Save