Merge branch 'feature/market_percentage' of wmtx/platform into release

市场专员业绩导出公式添加
master
廖金灵 4 years ago committed by Gogs
commit 279a017496

@ -183,6 +183,14 @@ class MarketPercentageController extends ThinkController
}
$market_percentage = json_decode($value['market_percentage'],true);
//开发业绩提成比例
$data[$key]['develop_commission_ratio'] = $market_percentage['develop_commission_ratio'];
//维护业绩提成比例
$data[$key]['maintain_commission_ratio'] = $market_percentage['maintain_commission_ratio'];
//开发考核奖金比例
$data[$key]['appraisal_bonuses_ratio'] = $market_percentage['appraisal_bonuses_ratio'];
//维护奖金考核比例
$data[$key]['maintain_appraisal_bonuses_ratio'] = $market_percentage['maintain_appraisal_bonuses_ratio'];
$month = date("m",strtotime($value['pay_time']));
$yes = date("Y",strtotime($value['pay_time']));
@ -293,7 +301,6 @@ class MarketPercentageController extends ThinkController
}
}
// die();
if ($_REQUEST['export']) {
@ -302,12 +309,26 @@ class MarketPercentageController extends ThinkController
'level' => '级别',
'performance_revenue' => '开发总流水',
'appraisal_bonuses' => '维护总流水',
'develop_commission_ratio'=>'开发业绩提成比例(%)',
'maintain_commission_ratio'=>'维护业绩提成比例(%)',
'appraisal_bonuses_ratio'=>'开发考核奖金比例(%)',
'maintain_appraisal_bonuses_ratio'=>'维护奖金考核比例(%)',
'company_profit'=>'税后毛利',
'performance_commission' => '业绩提成',
'achievement_bonus' => '绩效考核奖金',
'commission' => '当月总提成',
'extend_commission' => '应发金额',
'wait_commission' => '待发金额'];
foreach ($data as $key => $value) {
$line = $key+2;
// $develop_commission_ratio = $value['develop_commission_ratio']/100;
$data[$key]['performance_commission'] = "=ROUND(J{$line}*(F{$line}/100)+J{$line}*(G{$line}/100),2)";
$data[$key]['achievement_bonus'] = "=ROUND(J{$line}*(H{$line}/100)+J{$line}*(I{$line}/100),2)";
$data[$key]['commission'] = "=ROUND(K{$line}+L{$line},2)";
}
data2csv($data,'市场业绩提成',$title);
}
@ -327,13 +348,14 @@ class MarketPercentageController extends ThinkController
$map['group_id'] = ['in','11,12,21'];
$_REQUEST['pay_time']?($map['pay_time'] = $_REQUEST['pay_time']):'';
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
// $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
$_REQUEST['group_id']?($map['group_id'] = $_REQUEST['group_id']):'';
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
$map['admin_id'] = $admin_id;
if(is_administrator()) {
unset($map['admin_id']);
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
}
$data = M("market_altogether","tab_")
@ -399,8 +421,6 @@ class MarketPercentageController extends ThinkController
$sum['extend_commission'] += $data[$key]['extend_commission'] ;
$sum['wait_commission'] += $value['wait_performance_commission'] + $value['wait_achievement_commission'];
}
$this->assign("sum",$sum);
@ -550,6 +570,54 @@ class MarketPercentageController extends ThinkController
$_REQUEST['nickname']?$map['nickname'] = $_REQUEST['nickname']:'';
$_REQUEST['level']?$map['level'] = $_REQUEST['level']:'';
$search_date = [];
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$end = $_REQUEST['time_end'];
$start = $_REQUEST['time_start'];
$i = 0;
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
$search_date[] = $date;
$i++;
}while ($date < date('Y-m', strtotime("{$end} -1 month")));
if ($search_date) {
$map['pay_time'] = ['in', $search_date];
}
} elseif (isset($_REQUEST['time_start'])) {
$end = date("Y-m",time());
$start = $_REQUEST['time_start'];
$i = 0;
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
$search_date[] = $date;
$i++;
}while ($date < date('Y-m', strtotime("{$end} -1 month")));
if ($search_date) {
$map['pay_time'] = ['in', $search_date];
}
} elseif (isset($_REQUEST['time_end'])) {
$end = $_REQUEST['time_end'];
$start = '2019-08';
$i = 0;
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
$search_date[] = $date;
$i++;
}while ($date < date('Y-m', strtotime("{$end} -1 month")));
if ($search_date) {
$map['pay_time'] = ['in', $search_date];
}
}
$data = M("market_altogether","tab_")
->field("max(pay_time) pay_time,real_name,admin_id,nickname,level,sum(pay_amount) pay_amount,sum(extend_commission) extend_commission,
sum(performance_commission) performance_commission,sum(achievement_bonus) achievement_bonus,
@ -567,7 +635,7 @@ class MarketPercentageController extends ThinkController
->group("admin_id")
->select();
}
// dump($data);die();
foreach($data as $key => $value) {
if ($value['level'] == 21) {

@ -77,7 +77,7 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Promote/lists')}");
highlight_subnav("{:U('MarketPercentage/index')}");
$(function(){

@ -58,6 +58,14 @@
</volist>
</select>
</div>
<div class="input-list input-list-parent search_label_rehab">
<select id="admin_id" name="admin_id" class="select_gallery" style="width:120px;">
<option value="">请选择人员</option>
<volist name=":getMarketAdmin()" id="vo">
<option value="{$vo.uid}" <if condition="$vo.uid eq $_GET['admin_id']">selected=selected</if>>{$vo.real_name}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
@ -117,10 +125,10 @@
<td>
<if condition="$send_bonus_check eq true">
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send">发放</a>
<if>
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send_back">离职发放</a>
<if condition="$data['status'] eq 0">
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send">发放</a>
</if>
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send_back">离职发放</a>
</if>
</td>

@ -59,6 +59,16 @@
</volist>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-parent search_label_rehab">
<select id="real_name" name="real_name" class="select_gallery" style="width:120px;">
<option value="">请选择人员</option>
@ -145,6 +155,11 @@
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
@ -261,6 +276,22 @@
});
})
$('#time_start').datetimepicker({
format: 'yyyy-mm',
language:"zh-CN",
minView:2,
autoclose:true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm',
language:"zh-CN",
minView:2,
autoclose:true,
pickerPosition:'bottom-left'
})
})

Loading…
Cancel
Save