|
|
|
@ -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) {
|
|
|
|
|