commit
00243390ee
@ -0,0 +1,997 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
use User\Api\UserApi as UserApi;
|
||||
|
||||
/**
|
||||
* 后台首页控制器
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
class MarketPercentageController extends ThinkController
|
||||
{
|
||||
|
||||
public function index($row = 10, $p = 1){
|
||||
|
||||
$map = [];
|
||||
|
||||
// $_REQUEST['pay_time']?($map['pay_time'] = $_REQUEST['pay_time']):'';
|
||||
$_REQUEST['promote_id']?($map['promote_id'] = $_REQUEST['promote_id']):'';
|
||||
$_REQUEST['relation_game_id']?($map['relation_game_id'] = $_REQUEST['relation_game_id']):'';
|
||||
$_REQUEST['sdk_version']?($map['sdk_version'] = $_REQUEST['sdk_version']):'';
|
||||
|
||||
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
|
||||
$map['admin_id'] = $admin_id;
|
||||
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) {
|
||||
unset($map['admin_id']);
|
||||
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
|
||||
}
|
||||
|
||||
$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}")));
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($map);die();
|
||||
|
||||
$data = M("settleup_marketorder","tab_")
|
||||
->field("pay_time,promote_account,company_belong,member.real_name,develop_type,game_name,
|
||||
sum(pay_amount) pay_amount,sum(cp_amount) cp_amount,sum(promote_amount) promote_amount,
|
||||
sum(channel_amount) channel_amount, sum(company_tax) company_tax,sum(company_profit) company_profit")
|
||||
->join("left join sys_member member on member.uid=admin_id");
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
$data = $data->where($map)
|
||||
->group("promote_id,game_name,pay_time")
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
} else {
|
||||
$data = $data->page($p, $row)
|
||||
->where($map)
|
||||
->group("promote_id,game_name,pay_time")
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
}
|
||||
|
||||
$sum = M("settleup_marketorder","tab_")
|
||||
->field("pay_time,promote_account,company_belong,real_name,develop_type,game_name,
|
||||
sum(pay_amount) pay_amount,sum(cp_amount) cp_amount,sum(promote_amount) promote_amount,
|
||||
sum(channel_amount) channel_amount, sum(company_tax) company_tax,sum(company_profit) company_profit")
|
||||
->where($map)
|
||||
->find();
|
||||
|
||||
$this->assign("sum",$sum);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if ($value['company_belong'] == 0) {
|
||||
$data[$key]['company_belong'] = '内团';
|
||||
} else if ($value['company_belong'] == 1) {
|
||||
$data[$key]['company_belong'] = '外团';
|
||||
} else if ($value['company_belong'] == 2) {
|
||||
$data[$key]['company_belong'] = '外团-分发联盟';
|
||||
} else {
|
||||
$data[$key]['company_belong'] = '无';
|
||||
}
|
||||
|
||||
if ($value['develop_type'] == 1) {
|
||||
$data[$key]['develop_type'] = '自主开发';
|
||||
} else if ($value['develop_type'] == 2) {
|
||||
$data[$key]['develop_type'] = '自主开发及维护';
|
||||
} else if ($value['develop_type'] == 3) {
|
||||
$data[$key]['develop_type'] = '只维护';
|
||||
} else {
|
||||
$data[$key]['develop_type'] = '无';
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
|
||||
$title = ['pay_time' => '时间',
|
||||
'promote_account' => '会长账号',
|
||||
'company_belong' => '内外团',
|
||||
'real_name' => '所属市场专员',
|
||||
'develop_type' => '类型',
|
||||
'game_name' => '游戏名称',
|
||||
'pay_amount' => '总流水',
|
||||
'cp_amount' => '上游结算流水',
|
||||
'promote_amount' => '下游结算流水',
|
||||
'channel_amount' => '支付渠道费用',
|
||||
'company_tax' => '公司税费',
|
||||
'company_profit' => '税后毛利额'];
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$data[$key]['pay_time'] = '`'.$data[$key]['pay_time'];
|
||||
}
|
||||
|
||||
$sum['pay_time'] = '';
|
||||
$sum['promote_account'] = '';
|
||||
$sum['company_belong'] = '合计';
|
||||
$sum['real_name'] = '';
|
||||
$sum['develop_type'] = '';
|
||||
$sum['game_name'] = '';
|
||||
|
||||
$data = array_merge($data,[$sum]);
|
||||
|
||||
data2csv($data,'市场毛利统计',$title);
|
||||
}
|
||||
|
||||
$count = M("settleup_marketorder","tab_")
|
||||
->where($map)
|
||||
->group("promote_id,game_name,pay_time")
|
||||
->select(false);
|
||||
|
||||
$count = M()->table("({$count}) count")->count();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->checkListOrCountAuthRestMap($map,[]);
|
||||
|
||||
$this->assign("list_data",$data);
|
||||
$this->display();
|
||||
|
||||
}
|
||||
|
||||
public function marketStaffSettle($row = 10, $p = 1) {
|
||||
|
||||
$map = [];
|
||||
|
||||
$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['group_id']?($map['level'] = $_REQUEST['group_id']):'';
|
||||
|
||||
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
|
||||
$map['admin_id'] = $admin_id;
|
||||
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) {
|
||||
unset($map['admin_id']);
|
||||
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
|
||||
}
|
||||
|
||||
|
||||
$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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
if ($search_date) {
|
||||
$map['pay_time'] = ['in', $search_date];
|
||||
}
|
||||
}
|
||||
|
||||
$_REQUEST['time_start']?($start_time = date("Y-m-1",strtotime($_REQUEST['time_start']))):'';
|
||||
$_REQUEST['time_end']?($end_time = date("Y-m-t",strtotime($_REQUEST['time_end']))):'';
|
||||
|
||||
$this->assign('start_time',$start_time);
|
||||
$this->assign('end_time',$end_time);
|
||||
|
||||
$data = M("market_altogether","tab_")
|
||||
->where($map);
|
||||
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
$data = $data
|
||||
->field("tab_market_altogether.*,market_percentage")
|
||||
->join("left join sys_auth_group_access access on tab_market_altogether.admin_id = access.uid")
|
||||
->join("left join sys_auth_group auth on access.group_id=auth.id")
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
} else {
|
||||
$data = $data
|
||||
->field("tab_market_altogether.*,market_percentage")
|
||||
->join("left join sys_auth_group_access access on tab_market_altogether.admin_id = access.uid")
|
||||
->join("left join sys_auth_group auth on access.group_id=auth.id")
|
||||
// ->page($p, $row)
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
}
|
||||
|
||||
$count = M("market_altogether","tab_")
|
||||
->where($map)
|
||||
->count();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->checkListOrCountAuthRestMap($map,[]);
|
||||
|
||||
|
||||
$all_data = M("market_altogether","tab_")
|
||||
// ->where($map)
|
||||
->select();
|
||||
$wait_amount = [];
|
||||
foreach ($all_data as $key => $value) {
|
||||
|
||||
$wait_amount[$value['admin_id'].$value['pay_time'].'performance_commission'] = $value['wait_performance_commission'];
|
||||
$wait_amount[$value['admin_id'].$value['pay_time'].'achievement_bonus'] = $value['wait_achievement_commission'];
|
||||
|
||||
}
|
||||
|
||||
$sum = [];
|
||||
$sum['performance_revenue'] = 0;
|
||||
$sum['performance_commission'] = 0;
|
||||
$sum['achievement_bonus'] = 0;
|
||||
$sum['commission'] = 0;
|
||||
$sum['extend_commission'] = 0;
|
||||
$sum['wait_commission'] = 0;
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
$data[$key]['start_time'] = date("Y-m-1",strtotime($value['pay_time']));
|
||||
$data[$key]['end_time'] = date("Y-m-t",strtotime($value['pay_time']));
|
||||
|
||||
if ($value['level'] == 21) {
|
||||
$data[$key]['level'] = '初级';
|
||||
} else if ($value['level'] == 11) {
|
||||
$data[$key]['level'] = '中级';
|
||||
} else if ($value['level'] == 12) {
|
||||
$data[$key]['level'] = '高级';
|
||||
}
|
||||
|
||||
$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']));
|
||||
|
||||
$data[$key]['commission'] = number_format($data[$key]['performance_commission'] + $data[$key]['achievement_bonus'], 2, '.', '');
|
||||
$data[$key]['wait_commission'] = substr(number_format($value['wait_performance_commission'] + $value['wait_achievement_commission'], 4, '.', ''),0,-2);
|
||||
$data[$key]['extend_commission'] = $data[$key]['commission'] - $data[$key]['wait_commission'];
|
||||
|
||||
if ($market_percentage['time'] == 1) {
|
||||
|
||||
if ($month == '07') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'performance_commission'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'performance_commission'];
|
||||
} elseif($month == '10') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'performance_commission'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'07'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'08'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'09'.'performance_commission'];
|
||||
} elseif($month == '04') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'performance_commission'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'performance_commission'];
|
||||
} elseif($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'07'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'08'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'09'.'performance_commission'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'performance_commission'];
|
||||
}
|
||||
} elseif($market_percentage['time'] == 2) {
|
||||
if ($month == '07') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'performance_commission'] +
|
||||
$wait_amount[$value['admin_id'].$yes.'-'.'04'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'performance_commission'];
|
||||
} elseif($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'07'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'08'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'09'.'performance_commission'] +
|
||||
$wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'performance_commission'];
|
||||
}
|
||||
} elseif($market_percentage['time'] == 3) {
|
||||
if ($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '01'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '02'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '03'.'performance_commission'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '04'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '05'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '06'.'performance_commission'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '07'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '08'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '09'.'performance_commission'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '10'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '11'.'performance_commission'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '12'.'performance_commission'];
|
||||
}
|
||||
} else {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'] .date("Y-m",strtotime("last month",strtotime($value['pay_time']))).'performance_commission'];
|
||||
}
|
||||
|
||||
if ($market_percentage['remain_time'] == 1) {
|
||||
if ($month == '07') {
|
||||
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'achievement_bonus'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'achievement_bonus'];
|
||||
// dump($data[$key]['extend_commission']);die();
|
||||
} elseif($month == '10') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'achievement_bonus'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'07'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'08'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'09'.'achievement_bonus'];
|
||||
} elseif($month == '04') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'achievement_bonus'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'achievement_bonus'];
|
||||
}
|
||||
elseif($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'07'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'08'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'09'.'achievement_bonus'];
|
||||
// $data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'achievement_bonus'];
|
||||
}
|
||||
} elseif($market_percentage['remain_time'] == 2) {
|
||||
if ($month == '07') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'achievement_bonus'] +
|
||||
$wait_amount[$value['admin_id'].$yes.'-'.'04'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'achievement_bonus'];
|
||||
} elseif($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'07'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'08'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'09'.'achievement_bonus'] +
|
||||
$wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'achievement_bonus'];
|
||||
}
|
||||
} elseif($market_percentage['remain_time'] == 3) {
|
||||
if ($month == '01') {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '01'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '02'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '03'.'achievement_bonus'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '04'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '05'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '06'.'achievement_bonus'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '07'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '08'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '09'.'achievement_bonus'] +
|
||||
$wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '10'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '11'.'achievement_bonus'] + $wait_amount[$value['admin_id'] . ($yes - 1) . '-' . '12'.'achievement_bonus'];
|
||||
}
|
||||
} else {
|
||||
$data[$key]['extend_commission'] += $wait_amount[$value['admin_id'] .date("Y-m",strtotime("last month",strtotime($value['pay_time']))).'achievement_bonus'];
|
||||
}
|
||||
// $data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', '');
|
||||
//
|
||||
|
||||
|
||||
if ($market_percentage['time'] == 1) {
|
||||
|
||||
if ($month == '07') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'performance_commission'];
|
||||
} elseif($month == '10') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'07'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'08'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'09'.'performance_commission'];
|
||||
} elseif($month == '04') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'performance_commission'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'performance_commission'];
|
||||
} elseif($month == '01') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'performance_commission'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'performance_commission'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($market_percentage['remain_time'] == 1) {
|
||||
if ($month == '07') {
|
||||
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'04'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'05'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'06'.'achievement_bonus'];
|
||||
// dump($data[$key]['extend_commission']);die();
|
||||
} elseif($month == '10') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'07'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'08'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'09'.'achievement_bonus'];
|
||||
} elseif($month == '04') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].$yes.'-'.'01'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'02'.'achievement_bonus'] + $wait_amount[$value['admin_id'].$yes.'-'.'03'.'achievement_bonus'];
|
||||
}
|
||||
elseif($month == '01') {
|
||||
$data[$key]['wait_commission'] += $wait_amount[$value['admin_id'].($yes-1).'-'.'10'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'11'.'achievement_bonus'] + $wait_amount[$value['admin_id'].($yes-1).'-'.'12'.'achievement_bonus'];
|
||||
}
|
||||
}
|
||||
|
||||
$data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'],2,'.','');
|
||||
$data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'],2,'.','');
|
||||
|
||||
$sum['performance_revenue'] += $data[$key]['performance_revenue'];
|
||||
$sum['appraisal_bonuses'] += $data[$key]['appraisal_bonuses'];
|
||||
$sum['performance_commission'] += $data[$key]['performance_commission'];
|
||||
$sum['achievement_bonus'] += $data[$key]['achievement_bonus'];
|
||||
$sum['commission'] += $data[$key]['commission'];
|
||||
$sum['extend_commission'] += $data[$key]['extend_commission'];
|
||||
|
||||
}
|
||||
$sum['wait_commission'] = '-------';
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
|
||||
$title = ['pay_time' => '时间',
|
||||
'real_name' => '市场人员',
|
||||
'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]['pay_time'] = '`'.$data[$key]['pay_time'];
|
||||
$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)";
|
||||
}
|
||||
|
||||
$data = array_merge($data,[$sum]);
|
||||
|
||||
data2csv($data,'市场业绩提成',$title);
|
||||
}
|
||||
|
||||
$arraypage = $p;
|
||||
$size = $row;//每页显示的记录数
|
||||
$data = array_slice($data, ($arraypage - 1) * $size, $size);
|
||||
|
||||
$this->assign("sum",$sum);
|
||||
$this->assign("list_data",$data);
|
||||
$this->display("marketstaffsettle");
|
||||
|
||||
}
|
||||
|
||||
public function personMarketStaffSettle($row = 10, $p = 1) {
|
||||
// var_dump(getMarketAdmin());
|
||||
$map = [];
|
||||
|
||||
$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['group_id']?($map['group_id'] = $_REQUEST['group_id']):'';
|
||||
($_REQUEST['status']||$_REQUEST['status']=='0')?($map['status'] = $_REQUEST['status']):'';
|
||||
|
||||
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
|
||||
$map['admin_id'] = $admin_id;
|
||||
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) {
|
||||
unset($map['admin_id']);
|
||||
$_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):'';
|
||||
}
|
||||
|
||||
$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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
if ($search_date) {
|
||||
$map['pay_time'] = ['in', $search_date];
|
||||
}
|
||||
}
|
||||
|
||||
$data = M("market_altogether","tab_")
|
||||
->where($map);
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
$data = $data
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
} else {
|
||||
$data = $data
|
||||
// ->page($p, $row)
|
||||
->order("pay_time DESC")
|
||||
->select();
|
||||
}
|
||||
|
||||
$count = M("market_altogether","tab_")
|
||||
->where($map)
|
||||
->count();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->checkListOrCountAuthRestMap($map,[]);
|
||||
|
||||
$sum['performance_revenue'] = 0;
|
||||
$sum['appraisal_bonuses'] = 0;
|
||||
$sum['company_profit'] = 0;
|
||||
$sum['performance_commission'] = 0;
|
||||
$sum['achievement_bonus'] = 0;
|
||||
$sum['commission'] = 0;
|
||||
$sum['extend_commission'] = 0;
|
||||
$sum['wait_commission'] = 0;
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
$data[$key]['start_time'] = date("Y-m-1",strtotime($value['pay_time']));
|
||||
$data[$key]['end_time'] = date("Y-m-t",strtotime($value['pay_time']));
|
||||
|
||||
if ($value['level'] == 21) {
|
||||
$data[$key]['level'] = '初级';
|
||||
} else if ($value['level'] == 11) {
|
||||
$data[$key]['level'] = '中级';
|
||||
} else if ($value['level'] == 12) {
|
||||
$data[$key]['level'] = '高级';
|
||||
}
|
||||
|
||||
if ($value['status'] > 0) {
|
||||
$data[$key]['is_send'] = '已发放';
|
||||
} else {
|
||||
$data[$key]['is_send'] = '未发放';
|
||||
}
|
||||
|
||||
$data[$key]['wait_commission'] =
|
||||
number_format($value['wait_performance_commission'] + $value['wait_achievement_commission'], 2, '.', '');
|
||||
|
||||
$data[$key]['commission'] = $data[$key]['performance_commission'] + $data[$key]['achievement_bonus'];
|
||||
$data[$key]['extend_commission'] = $data[$key]['commission'] - $data[$key]['wait_commission'];
|
||||
|
||||
$sum['performance_revenue'] += $value['performance_revenue'];
|
||||
$sum['appraisal_bonuses'] += $value['appraisal_bonuses'];
|
||||
|
||||
$sum['company_profit'] += $value['company_profit'];
|
||||
$sum['performance_commission'] += $value['performance_commission'];
|
||||
$sum['achievement_bonus'] += $value['achievement_bonus'];
|
||||
$sum['commission'] += $data[$key]['commission'];
|
||||
$sum['extend_commission'] += $data[$key]['extend_commission'] ;
|
||||
$sum['wait_commission'] += $value['wait_performance_commission'] + $value['wait_achievement_commission'];
|
||||
|
||||
}
|
||||
|
||||
$sum['performance_revenue'] = number_format($sum['performance_revenue'], 2, '.', '');
|
||||
$sum['appraisal_bonuses'] = number_format($sum['appraisal_bonuses'], 2, '.', '');
|
||||
|
||||
$sum['company_profit'] = number_format($sum['company_profit'], 2, '.', '');
|
||||
$sum['performance_commission'] = number_format($sum['performance_commission'], 2, '.', '');
|
||||
$sum['achievement_bonus'] = number_format($sum['achievement_bonus'], 2, '.', '');
|
||||
$sum['commission'] = number_format($sum['commission'], 2, '.', '');
|
||||
$sum['extend_commission'] = number_format($sum['extend_commission'], 2, '.', '');
|
||||
$sum['wait_commission'] = number_format($sum['wait_commission'], 2, '.', '');
|
||||
|
||||
$this->assign("sum",$sum);
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
|
||||
$title = ['pay_time' => '时间',
|
||||
'real_name' => '市场人员',
|
||||
'nickname' => '账号',
|
||||
'level' => '级别',
|
||||
'performance_revenue' => '开发总流水',
|
||||
'appraisal_bonuses' => '维护总流水',
|
||||
'company_profit'=>'税后毛利',
|
||||
'performance_commission' => '业绩提成',
|
||||
'achievement_bonus' => '绩效考核奖金',
|
||||
'commission' => '当月总提成',
|
||||
'extend_commission' => '本月发放',
|
||||
'wait_commission' => '本月未发',
|
||||
'is_send'=>'剩余金额发放状态'];
|
||||
|
||||
$data = array_merge($data,[$sum]);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$data[$key]['pay_time'] = '`'.$data[$key]['pay_time'];
|
||||
}
|
||||
|
||||
data2csv($data,'个人总提成列表',$title);
|
||||
}
|
||||
$arraypage = $p;
|
||||
$size = $row;//每页显示的记录数
|
||||
$data = array_slice($data, ($arraypage - 1) * $size, $size);
|
||||
|
||||
$this->assign("list_data",$data);
|
||||
$this->display("personmarketstaffsettle");
|
||||
|
||||
}
|
||||
|
||||
public function sendBonus() {
|
||||
|
||||
$map['pay_time'] = $_REQUEST['pay_time'];
|
||||
$map['admin_id'] = $_REQUEST['admin_id'];
|
||||
|
||||
if (!$_REQUEST['pay_time']||!$_REQUEST['admin_id']) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>'数据错误']);
|
||||
}
|
||||
|
||||
$check_data = M("market_altogether","tab_")
|
||||
->where(['pay_time'=>$_REQUEST['pay_time'],'admin_id'=>$_REQUEST['admin_id']])
|
||||
->find();
|
||||
|
||||
//正常发放添加判断,不让他重新发放
|
||||
if (!$_REQUEST['all']&&$check_data) {
|
||||
|
||||
if ($check_data['status'] >0) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>'已经发放过,请勿重复操作']);
|
||||
}
|
||||
}
|
||||
//判断是否已经离职发放过
|
||||
if($_REQUEST['all']) {
|
||||
if ($check_data['status']==2) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>'离职发放已经发放过']);
|
||||
}
|
||||
}
|
||||
|
||||
// $group_config = M("auth_group_access access")
|
||||
// ->field("market_percentage")
|
||||
// ->join("left join sys_auth_group auth on access.group_id=auth.id")
|
||||
// ->where(['uid'=>$_REQUEST['admin_id']])
|
||||
// ->find();
|
||||
// $group_config = json_decode($group_config['market_percentage'],true);
|
||||
// $month = date("m",strtotime($_REQUEST['pay_time']));
|
||||
// $yes = date("Y",strtotime($_REQUEST['pay_time']));
|
||||
// if ($group_config['time'] == 1) {
|
||||
// if ($month == '07') {
|
||||
// $where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03'];
|
||||
// if ($_REQUEST['all']) {
|
||||
// $where = array_merge($where,[$yes.'-'.'04',$yes.'-'.'05',$yes.'-'.'06']);
|
||||
// }
|
||||
// } elseif($month == '10') {
|
||||
// $where = [$yes.'-'.'04',$yes.'-'.'05',$yes.'-'.'06'];
|
||||
// if ($_REQUEST['all']) {
|
||||
// $where = array_merge($where,[$yes.'-'.'07',$yes.'-'.'08',$yes.'-'.'09']);
|
||||
// }
|
||||
// } elseif($month == '04') {
|
||||
// $where = [($yes-1).'-'.'10',($yes-1).'-'.'11',($yes-1).'-'.'12'];
|
||||
// if ($_REQUEST['all']) {
|
||||
// $where = array_merge($where,[$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03']);
|
||||
// }
|
||||
// } elseif($month == '01') {
|
||||
// $where = [($yes-1).'-'.'07',($yes-1).'-'.'08',($yes-1).'-'.'09'];
|
||||
// if ($_REQUEST['all']) {
|
||||
// $where = array_merge($where,[$yes.'-'.'10',$yes.'-'.'11',$yes.'-'.'12']);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } elseif($group_config['time'] == 2) {
|
||||
// if ($month == '07') {
|
||||
// $where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03',$yes.'-'.'04',$yes.'-'.'05',$yes.'-'.'06'];
|
||||
// } elseif($month == '01') {
|
||||
// $where = [($yes-1).'-'.'07',($yes-1).'-'.'08',($yes-1).'-'.'09',($yes-1).'-'.'10',($yes-1).'-'.'11',($yes-1).'-'.'12'];
|
||||
// }
|
||||
// } elseif($group_config['time'] == 3) {
|
||||
// if ($month == '01') {
|
||||
// $where = [($yes-1).'-'.'01',($yes-1).'-'.'02',($yes-1).'-'.'03',($yes-1).'-'.'04',($yes-1).'-'.'05',($yes-1).'-'.'06',
|
||||
// ($yes-1).'-'.'07',($yes-1).'-'.'08',($yes-1).'-'.'09',($yes-1).'-'.'10',($yes-1).'-'.'11',($yes-1).'-'.'12'];
|
||||
// }
|
||||
// } else {
|
||||
// $where = [date("Y-m",strtotime("last month",strtotime($_REQUEST['pay_time'])))];
|
||||
// }
|
||||
$save['status'] = 1;
|
||||
$save['remark'] = '手动发放';
|
||||
if ($_REQUEST['all']) {
|
||||
unset($map['pay_time']);
|
||||
$save['status'] = 2;
|
||||
$save['remark'] = '离职发放';
|
||||
}
|
||||
|
||||
$is_save = M("market_altogether","tab_")
|
||||
->where($map)
|
||||
->save($save);
|
||||
|
||||
if ($is_save) {
|
||||
$this->ajaxReturn(['status'=>1,'msg'=>'发放成功']);
|
||||
} else {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>'发放失败']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function reCaculateBonus() {
|
||||
|
||||
$pay_time = $_REQUEST['pay_time'];
|
||||
|
||||
if (!$pay_time) {
|
||||
$pay_time = "all";
|
||||
// $pay_time = date("Y-m",strtotime('-1 month'));
|
||||
}
|
||||
|
||||
// var_dump("cd ".ROOTTT.";php admin.php timing/caculateMarketStream/time/{$pay_time} > /dev/null &");die();
|
||||
|
||||
exec("source /etc/profile;cd ".ROOTTT.";php admin.php timing/caculateMarketStream/time/{$pay_time} > /dev/null &");
|
||||
|
||||
$this->ajaxReturn(['status'=>1]);
|
||||
}
|
||||
|
||||
public function showBonusList($row = 10, $p = 1) {
|
||||
|
||||
//排序
|
||||
if(!array_key_exists("time_start",$_REQUEST)){
|
||||
$this->redirect(ACTION_NAME, array('time_start' => date('Y-m',strtotime('-1 month')),"time_end"=>date('Y-m',strtotime('-1 month'))));
|
||||
}
|
||||
|
||||
$map = [];
|
||||
|
||||
$_REQUEST['pay_time']?$map['pay_time'] = $_REQUEST['pay_time']:'';
|
||||
$_REQUEST['real_name']?$map['real_name'] = $_REQUEST['real_name']:'';
|
||||
$_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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
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}")));
|
||||
|
||||
if ($search_date) {
|
||||
$map['pay_time'] = ['in', $search_date];
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['pay_time']) {
|
||||
if (in_array($_REQUEST['pay_time'],$search_date)) {
|
||||
$map['pay_time'] = $_REQUEST['pay_time'];
|
||||
} elseif(isset($_REQUEST['time_start']) || isset($_REQUEST['time_end'])) {
|
||||
$this->checkListOrCountAuthRestMap($map,[]);
|
||||
$this->assign("list_data",[]);
|
||||
$this->display("showbonuslist");
|
||||
die();
|
||||
} else {
|
||||
$map['pay_time'] = $_REQUEST['pay_time'];
|
||||
}
|
||||
}
|
||||
// var_dump($map);die();
|
||||
$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,
|
||||
sum(wait_performance_commission)+sum(wait_achievement_commission) wait_amount,
|
||||
sum(if(status > 0, wait_performance_commission, '0.00')) + sum(if(status > 0, wait_achievement_commission,'0.00')) wait_extend_commission,
|
||||
sum(if(status = 0, wait_performance_commission, '0.00')) + sum(if(status = 0, wait_achievement_commission, '0.00')) wait_commission, remark,level,status")
|
||||
->where($map);
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
$data = $data
|
||||
->order("pay_time DESC")
|
||||
->group("admin_id")
|
||||
->select();
|
||||
} else {
|
||||
$data = $data
|
||||
// ->page($p, $row)
|
||||
->order("pay_time DESC")
|
||||
->group("admin_id")
|
||||
->select();
|
||||
}
|
||||
|
||||
$sum = [];
|
||||
$sum['pay_amount'] = 0;
|
||||
$sum['extend_commission'] = 0;
|
||||
$sum['wait_commission'] = 0;
|
||||
|
||||
foreach($data as $key => $value) {
|
||||
|
||||
if ($value['level'] == 21) {
|
||||
$data[$key]['level'] = '初级';
|
||||
} else if ($value['level'] == 11) {
|
||||
$data[$key]['level'] = '中级';
|
||||
} else if ($value['level'] == 12) {
|
||||
$data[$key]['level'] = '高级';
|
||||
}
|
||||
|
||||
$data[$key]['commission'] = $data[$key]['performance_commission'] + $data[$key]['achievement_bonus'];
|
||||
|
||||
$data[$key]['extend_commission'] = number_format($data[$key]['commission'] - $data[$key]['wait_commission'], 2, '.', '');
|
||||
$data[$key]['pay_amount'] = number_format($data[$key]['pay_amount'] , 2, '.', '');
|
||||
$data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'] , 2, '.', '');
|
||||
// $data[$key]['all_commission'] = $data[$key]['wait_amount'] + ;
|
||||
|
||||
$sum['pay_amount'] += $data[$key]['pay_amount'];
|
||||
$sum['extend_commission'] += $data[$key]['extend_commission'];
|
||||
$sum['wait_commission'] += $data[$key]['wait_commission'];
|
||||
$sum['commission'] += $data[$key]['commission'];
|
||||
|
||||
}
|
||||
|
||||
$sum['pay_amount'] = number_format($sum['pay_amount'], 2, '.', '');;
|
||||
$sum['extend_commission'] = number_format($sum['extend_commission'], 2, '.', '');;
|
||||
$sum['wait_commission'] = number_format($sum['wait_commission'], 2, '.', '');;
|
||||
|
||||
$_REQUEST['time_start']?($start_time = date("Y-m-1",strtotime($_REQUEST['time_start']))):$start_time = date("Y-m-1",strtotime(''));
|
||||
$_REQUEST['time_end']?($end_time = date("Y-m-t",strtotime($_REQUEST['time_end']))):'';
|
||||
$this->assign('start_time',$start_time);
|
||||
$this->assign('end_time',$end_time);
|
||||
|
||||
if ($_REQUEST['export']) {
|
||||
|
||||
$title = ['real_name' => '姓名',
|
||||
'nickname' => '账号',
|
||||
'level' => '级别',
|
||||
'pay_amount' => '总流水',
|
||||
'commission'=>'总提成',
|
||||
'extend_commission' => '已发放总提成',
|
||||
'wait_commission'=>'剩余未发放总提成'];
|
||||
|
||||
$data = array_merge($data,[$sum]);
|
||||
|
||||
data2csv($data,'提成汇总结算单',$title);
|
||||
}
|
||||
|
||||
$count = M("market_altogether","tab_")
|
||||
->where($map)
|
||||
->group("admin_id")
|
||||
->select(false);
|
||||
$count = M()->table("({$count}) count")->count();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
|
||||
$arraypage = $p;
|
||||
$size = $row;//每页显示的记录数
|
||||
$data = array_slice($data, ($arraypage - 1) * $size, $size);
|
||||
|
||||
$this->checkListOrCountAuthRestMap($map,[]);
|
||||
|
||||
$this->assign("sum",$sum);
|
||||
$this->assign("list_data",$data);
|
||||
$this->display("showbonuslist");
|
||||
|
||||
}
|
||||
|
||||
public function editTaxRatio() {
|
||||
|
||||
if (IS_POST) {
|
||||
|
||||
if (!$_POST['tax_radio']) {
|
||||
$this->error("税率不能填空");
|
||||
}
|
||||
|
||||
if (!$_POST['timestart']) {
|
||||
$this->error("生效时间不能填空");
|
||||
}
|
||||
|
||||
$data = $_POST;
|
||||
$data['time'] = strtotime($data['timestart']);
|
||||
$data['create_time'] = time();
|
||||
|
||||
$is_hav = M("tax_radio","tab_")
|
||||
->where(['time'=>strtotime($data['timestart'])])
|
||||
->find();
|
||||
|
||||
M("tax_radio","tab_")
|
||||
->where(['time'=>['gt',strtotime($data['timestart'])]])
|
||||
->delete();
|
||||
|
||||
if ($is_hav) {
|
||||
$is_save = M("tax_radio","tab_")
|
||||
->where(['time'=>strtotime($data['timestart'])])
|
||||
->save($data);
|
||||
} else {
|
||||
$is_save = M("tax_radio","tab_")->add($data);
|
||||
}
|
||||
|
||||
$this->success("保存成功",U("index"));
|
||||
|
||||
} else {
|
||||
|
||||
$data = M("tax_radio","tab_")
|
||||
->field("tax_radio,time timestart")
|
||||
->order("create_time DESC")
|
||||
->find();
|
||||
|
||||
$data['timestart'] = Date("Y-m",$data['timestart']);
|
||||
|
||||
$this->assign('data',$data);
|
||||
$this->display("edittaxratio");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
<!-- 成员授权编辑页面 -->
|
||||
<extend name="Public/base" />
|
||||
<block name="body">
|
||||
<div class="main-place">
|
||||
<span class="main-placetitle">位置</span>
|
||||
<ul class="main-placeul">
|
||||
<li><a href="{:U('User/index')}">用户</a></li>
|
||||
<li><a href="{:U('User/index')}">管理组</a></li>
|
||||
<li><a href="#">{$meta_title}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-wrap">
|
||||
<div class="tab_nav">
|
||||
<ul>
|
||||
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
|
||||
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
|
||||
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
|
||||
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
|
||||
<li class="current"><a href="javascript:;">市场专员分成</a></li>
|
||||
<li class="fr tab_select">
|
||||
<select name="group">
|
||||
<volist name="auth_group" id="vo">
|
||||
<option value="{:U('AuthManager/AuthMarketMember',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" <eq name="vo['id']" value="$_GET['group_id']">selected</eq> >{$vo.title}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-wrap">
|
||||
|
||||
<div class="tab-content tabcon1711" style="margin-top: 20px;">
|
||||
<span style="font-size: 20px;font-weight: 600;padding-left: 15px;padding-bottom: 30px">市场专员分成</span>
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:U('AuthMarketMember?model='.$model['id'])}" method="post" class="form-horizontal">
|
||||
<!-- 基础文档模型 -->
|
||||
<div id="tab1" class="tab-pane in tab1" style="margin-top: 10px;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">业绩提成起提流水:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="performance_revenue" id="performance_revenue" value="{$data.performance_revenue}" onkeyup ="value=value.replace(/[^\d]/g,'')">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">开发业绩提成比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="develop_commission_ratio" id="develop_commission_ratio" value="{$data['develop_commission_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">维护业绩提成比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="maintain_commission_ratio" id="maintain_commission_ratio" value="{$data['maintain_commission_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">业绩月发放比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="performance_monthly_ratio" id="performance_monthly_ratio" value="{$data['performance_monthly_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">余下业绩发放时间选择:</td>
|
||||
<td class="r table_radio">
|
||||
<select name="time" class="select_gallery" id="time" style="text-align: center">
|
||||
<option value="0" <if condition="$data['time'] eq '0'">selected</if>>月</option>
|
||||
<option value="1" <if condition="$data['time'] eq '1'">selected</if>>跨季</option>
|
||||
<option value="2" <if condition="$data['time'] eq '2'">selected</if>>半年</option>
|
||||
<option value="3" <if condition="$data['time'] eq '3'">selected</if>>一年</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">考核奖金起提流水:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="appraisal_bonuses" id="appraisal_bonuses" value="{$data['appraisal_bonuses']}" onkeyup ="value=value.replace(/[^\d]/g,'')">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">开发考核奖金比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="appraisal_bonuses_ratio" id="appraisal_bonuses_ratio" value="{$data['appraisal_bonuses_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">维护考核奖金比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="maintain_appraisal_bonuses_ratio" id="maintain_appraisal_bonuses_ratio" value="{$data['maintain_appraisal_bonuses_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">奖金月发放比例:</td>
|
||||
<td class="r table_radio">
|
||||
<input type="text" name="month_bonus_ratio" id="month_bonus_ratio" value="{$data['month_bonus_ratio']}" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l" style="padding-left: 15px;">余下奖金发放时间选择:</td>
|
||||
<td class="r table_radio">
|
||||
<select name="remain_time" class="select_gallery" id="remain_time">
|
||||
<option value="0" <if condition="$data.remain_time eq '0'">selected</if>>月</option>
|
||||
<option value="1" <if condition="$data.remain_time eq '1'">selected</if>>跨季</option>
|
||||
<option value="2" <if condition="$data.remain_time eq '2'">selected</if>>半年</option>
|
||||
<option value="3" <if condition="$data.remain_time eq '3'">selected</if>>一年</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="form-item cf">
|
||||
|
||||
<input type="hidden" name="group_id" id="group_id" value="{$_GET['group_id']}">
|
||||
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal" >
|
||||
确认
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('index')}" style="color:#000000;background:#ffffff;border: solid 1px #000">
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-title" style="border-bottom: 0px solid #C1C1C1 !important;margin-bottom: 0;padding-bottom: 0">
|
||||
<div class="page_nav fl">
|
||||
{$_page}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabcon1711">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="AuthManager/index">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$('select[name=group]').change(function(){
|
||||
location.href = this.value;
|
||||
});
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('AuthManager/index')}');
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,130 @@
|
||||
<extend name="Public/base" />
|
||||
|
||||
<block name="body">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> -->
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
|
||||
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">公司税率修改</h3>
|
||||
<p class="description_text">提示:修改税率后请点击“重算”</p>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tab-wrap">
|
||||
|
||||
<div class="tab-content tabcon1711">
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:U('editTaxRatio?model='.$model['id'])}" method="post" class="form-horizontal">
|
||||
<!-- 基础文档模型 -->
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l" style="width: 150px;">原税率:</td>
|
||||
<td class="l" style="width: 250px;">
|
||||
{$data['tax_radio']}%
|
||||
</td>
|
||||
|
||||
<td class="l" style="width: 150px;">修改后税率:</td>
|
||||
<td class="l">
|
||||
<input type="text" class="txt" name="tax_radio" value="" onKeyUp="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">生效时间点:</td>
|
||||
<td class="r">
|
||||
<input type="text" id="timestart" name="timestart" class="" value="{$data['timestart']}" placeholder="下单开始时间" autocomplete="off"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="form-item cf">
|
||||
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
|
||||
应用
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back(-1);" >
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/1">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></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 type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav("{:U('MarketPercentage/index')}");
|
||||
|
||||
$(function(){
|
||||
|
||||
$('#timestart').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
})
|
||||
// var pro="{:$data['bank_area']['0']}";
|
||||
// alert (pro);
|
||||
showTab();
|
||||
prov="{:substr($data['bank_area'],0,2)}";
|
||||
city="{:substr($data['bank_area'],2,2)}";
|
||||
ciarea="{:substr($data['bank_area'],4,2)}";
|
||||
//initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, prov, city, ciarea);
|
||||
|
||||
$("input[name=company_belong]").click(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#company_relation').show();
|
||||
} else {
|
||||
$('#company_relation').hide();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</block>
|
||||
|
@ -0,0 +1,487 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">市场毛利统计</h3>
|
||||
<p class="description_text">说明:市场毛利统计</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
<div class="fl button_list">
|
||||
<div class="tools">
|
||||
<if condition="$caculate_check eq true">
|
||||
<empty name="show_status">
|
||||
<a class="recaculate" url="{:U('reCaculateBonus?pay_time='.$_GET['pay_time'])}"><span class="button_icon button_icon1"></span>重算</a>
|
||||
</empty>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<!-- <div class="input-list input-list-promote search_label_rehab">-->
|
||||
<!-- <select id="pay_time" name="pay_time" class="select_gallery" style="width:150px;">-->
|
||||
<!-- <option value="">请选择月份</option>-->
|
||||
<!-- <volist name=":getMonth()" id="vo">-->
|
||||
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['pay_time']">selected=selected</if>>{$vo}</option>-->
|
||||
<!-- </volist>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<div class="input-list">
|
||||
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
|
||||
-
|
||||
<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="promote_id" name="promote_id" class="select_gallery" style="width:120px;">
|
||||
<option value="">请选择会长账号</option>
|
||||
<volist name=":promote_listsMarket(1)" id="vo">
|
||||
<option data-company_belong="{$vo['company_belong']}" data-belong="{:getCompanyBlong($vo['company_belong'])}" promote_id-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['promote_id']">selected=selected</if>>{$vo.account}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="relation_game_id" name="relation_game_id" class="select_gallery" style="width:120px;">
|
||||
<option value="" selected="">请选择游戏</option>
|
||||
<volist name=':get_game_list(null,2)' id='vo'>
|
||||
<option value="{$vo.relation_game_id}" <if condition="$vo.relation_game_id eq $_GET['relation_game_id']"></if>>{$vo.relation_game_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('index','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>时间</th>
|
||||
<th>会长账号</th>
|
||||
<th>内外团</th>
|
||||
<th>所属市场专员</th>
|
||||
<th>类型</th>
|
||||
<th >游戏名称</th>
|
||||
<th >总流水</th>
|
||||
<th>上游结算流水</th>
|
||||
<th>下游结算流水</th>
|
||||
<th>支付渠道费用</th>
|
||||
<th><a href="{:U('editTaxRatio')}" style="text-decoration:none;">公司税费</a></th>
|
||||
<th>税后毛利额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($list_data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "list_data">
|
||||
<volist name="list_data" id="data">
|
||||
<tr>
|
||||
<td>{$data.pay_time}</td>
|
||||
<td>{$data.promote_account}</td>
|
||||
<td>{$data.company_belong}</td>
|
||||
<td>{$data.real_name}</td>
|
||||
<td>{$data['develop_type']}</td>
|
||||
<td>{$data['game_name']}</td>
|
||||
<td>{$data['pay_amount']}</td>
|
||||
<td>{$data['cp_amount']}</td>
|
||||
<td>{$data['promote_amount']}</td>
|
||||
<td>{$data['channel_amount']}</td>
|
||||
<td>{$data['company_tax']}</td>
|
||||
<td>{$data['company_profit']}</td>
|
||||
</tr>
|
||||
</volist>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>合计</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{$sum['pay_amount']}</td>
|
||||
<td>{$sum['cp_amount']}</td>
|
||||
<td>{$sum['promote_amount']}</td>
|
||||
<td>{$sum['channel_amount']}</td>
|
||||
<td>{$sum['company_tax']}</td>
|
||||
<td>{$sum['company_profit']}</td>
|
||||
</tr>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<else/>
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</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 type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('MarketPercentage/index')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
|
||||
var start = $("#time_start").val();
|
||||
var end = $("#time_end").val();
|
||||
if(start !='' && end != ''){
|
||||
if (Date.parse(start) > Date.parse(end)){
|
||||
layer.msg('开始时间必须小于等于结束时间');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
$('#time_start').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
})
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('.recaculate').click(function(){
|
||||
var url = $(this).attr('url');
|
||||
layer.confirm('是否确认重算提成!', {
|
||||
title:'重算提成?',
|
||||
icon:0,
|
||||
btn: ['重算','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success:function(data){
|
||||
if(data.status == 1) {
|
||||
layer.msg("重新计算需要时间,请等待5分钟后再查看");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.info);
|
||||
}
|
||||
},
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
var checked = 'checked';
|
||||
|
||||
|
||||
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
$(".jsgamecheckall").attr('checked',false);
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
checked = '';
|
||||
}
|
||||
}
|
||||
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").attr('checked',checked);
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
var tip_msg = res.info ? res.info : '操作失败';
|
||||
layer.msg(tip_msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,480 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
a:link ,a:visited,a:hover,a:active { text-decoration: none;}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">市场业绩提成</h3>
|
||||
<p class="description_text">说明:公会统计仅表示符合筛选条件下的数据统计,当搜索所属市场专员时,因为存在换绑等原因,所以不作为市场业绩统计依据</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
<div class="fl button_list">
|
||||
<div class="tools">
|
||||
<if condition="$caculate_check eq true">
|
||||
<empty name="show_status">
|
||||
<a class="recaculate" url="{:U('reCaculateBonus?pay_time='.$_GET['pay_time'])}"><span class="button_icon button_icon1"></span>重算</a>
|
||||
</empty>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<!-- <div class="input-list input-list-promote search_label_rehab">-->
|
||||
<!-- <select id="pay_time" name="pay_time" class="select_gallery" style="width:150px;">-->
|
||||
<!-- <option value="">请选择时间</option>-->
|
||||
<!-- <volist name=":getMonth()" id="vo">-->
|
||||
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['pay_time']">selected=selected</if>>{$vo}</option>-->
|
||||
<!-- </volist>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<div class="input-list">
|
||||
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
|
||||
-
|
||||
<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="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>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="group_id" name="group_id" class="select_gallery" style="width:120px;">
|
||||
<option value="" selected="">请选择级别</option>
|
||||
<option value="21" <if condition="$_GET['group_id'] eq 1">selected</if>>初级</option>
|
||||
<option value="11" <if condition="$_GET['group_id'] eq 2">selected</if>>中级</option>
|
||||
<option value="12" <if condition="$_GET['group_id'] eq 2">selected</if>>高级</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('marketStaffSettle','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>时间</th>
|
||||
<th>市场专员</th>
|
||||
<th>级别</th>
|
||||
<th>开发总流水</th>
|
||||
<th>维护总流水</th>
|
||||
<th >业绩提成</th>
|
||||
<th >绩效考核奖金</th>
|
||||
<th>当月合计</th>
|
||||
<th>应发金额</th>
|
||||
<th>待发金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($list_data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "list_data">
|
||||
<volist name="list_data" id="data">
|
||||
<tr>
|
||||
<td>{$data.pay_time|default='无'}</td>
|
||||
<td>{$data.real_name|default='无'}</td>
|
||||
<td>{$data.level|default='无'}</td>
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'admin_id'=>$data['admin_id'],'develop_type'=>'1,2'))}" >{$data.performance_revenue|default='0.00'}</a></td>
|
||||
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'admin_id'=>$data['admin_id'],'develop_type'=>3))}" >{$data['appraisal_bonuses']|default='0.00'}</a></td>
|
||||
<td>{$data['performance_commission']|default='0.00'}</td>
|
||||
<td>{$data['achievement_bonus']|default='0.00'}</td>
|
||||
<td>{$data['commission']|default='0.00'}</td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'admin_id'=>$data['admin_id']))}" >{$data['extend_commission']|default='0.00'}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/showBonusList',array('pay_time'=>$data['pay_time'],'real_name'=>$data['real_name'],'level'=>$data['group_id']))}" >{$data['wait_commission']|default='0.00'}</a></td>
|
||||
</tr>
|
||||
</volist>
|
||||
<td colspan="3">合计</td>
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$start_time,'time_end'=>$end_time,'develop_type'=>'1,2'))}" >{$sum['performance_revenue']|default="0.00"}</a></td>
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$start_time,'time_end'=>$end_time,'develop_type'=>3))}" >{$sum['appraisal_bonuses']|default='0.00'}</a></td>
|
||||
<td>{$sum['performance_commission']|default='0.00'}</td>
|
||||
<td>{$sum['achievement_bonus']|default='0.00'}</td>
|
||||
<td>{$sum['commission']|default='0.00'}</td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('pay_time'=>$data['pay_time']))}" >{$sum['extend_commission']|default='0.00'}</a></td>
|
||||
<td></td>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<else/>
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</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 type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('MarketPercentage/marketStaffSettle')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
|
||||
var start = $("#time_start").val();
|
||||
var end = $("#time_end").val();
|
||||
if(start !='' && end != ''){
|
||||
if (Date.parse(start) > Date.parse(end)){
|
||||
layer.msg('开始时间必须小于等于结束时间');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('#time_start').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
})
|
||||
|
||||
$('.recaculate').click(function(){
|
||||
var url = $(this).attr('url');
|
||||
layer.confirm('是否确认重算提成!', {
|
||||
title:'重算提成?',
|
||||
icon:0,
|
||||
btn: ['重算','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success:function(data){
|
||||
if(data.status == 1) {
|
||||
layer.msg("重新计算需要时间,请等待5分钟后再查看");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.info);
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
var checked = 'checked';
|
||||
|
||||
|
||||
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
$(".jsgamecheckall").attr('checked',false);
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
checked = '';
|
||||
}
|
||||
}
|
||||
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").attr('checked',checked);
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
var tip_msg = res.info ? res.info : '操作失败';
|
||||
layer.msg(tip_msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,538 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">个人总提成列表</h3>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
<div class="fl button_list">
|
||||
<div class="tools">
|
||||
<if condition="$caculate_check eq true">
|
||||
<a class="recaculate" url="{:U('reCaculateBonus?pay_time='.$_GET['pay_time'])}"><span class="button_icon button_icon1"></span>重算</a>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<!-- <div class="input-list input-list-promote search_label_rehab">-->
|
||||
<!-- <select id="pay_time" name="pay_time" class="select_gallery" style="width:150px;">-->
|
||||
<!-- <option value="">请选择时间</option>-->
|
||||
<!-- <volist name=":getMonth()" id="vo">-->
|
||||
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['pay_time']">selected=selected</if>>{$vo}</option>-->
|
||||
<!-- </volist>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<div class="input-list">
|
||||
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
|
||||
-
|
||||
<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="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>
|
||||
<div class="input-list input-list-parent search_label_rehab">
|
||||
<select id="status" name="status" class="select_gallery" style="width:120px;">
|
||||
<option value="">请选择剩余金额发放状态</option>
|
||||
<option value="1">已发放</option>
|
||||
<option value="0">未发放</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('personMarketStaffSettle','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>时间</th>
|
||||
<th>市场专员</th>
|
||||
<th>账号</th>
|
||||
<th>级别</th>
|
||||
<th>开发总流水</th>
|
||||
<th>维护总流水</th>
|
||||
<th>税后毛利</th>
|
||||
<th >业绩提成</th>
|
||||
<th >绩效考核奖金</th>
|
||||
<th>当月总提成</th>
|
||||
<th>本月发放</th>
|
||||
<th>本月未发</th>
|
||||
<th>剩余金额发放状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($list_data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "list_data">
|
||||
<volist name="list_data" id="data" key="index">
|
||||
<tr>
|
||||
<td>{$data.pay_time|default='无'}</td>
|
||||
<td>{$data.real_name|default='无'}</td>
|
||||
<td>{$data.nickname|default='无'}</td>
|
||||
<td>{$data.level|default='无'}</td>
|
||||
<td>{$data.performance_revenue|default='0.00'}</td>
|
||||
|
||||
<td>{$data['appraisal_bonuses']|default='0.00'}</td>
|
||||
<td>{$data.company_profit|default="0.00"}</td>
|
||||
<td>{$data['performance_commission']|default='0.00'}</td>
|
||||
<td>{$data['achievement_bonus']|default='0.00'}</td>
|
||||
<td>{$data['commission']|default='0.00'}</td>
|
||||
<td>{$data['extend_commission']|default='0.00'}</td>
|
||||
<td>{$data['wait_commission']|default='0.00'}</td>
|
||||
<td>{$data['is_send']|default='未发放'}</td>
|
||||
|
||||
<td>
|
||||
<if condition="$send_bonus_check eq true">
|
||||
<if condition="$data['status'] eq 0">
|
||||
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send">发放</a>
|
||||
<a data-admin_id="{$data.admin_id}" data-time="{$data.pay_time}" class="send_back">离职发放</a>
|
||||
</if>
|
||||
</if>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</volist>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>合计</td>
|
||||
<td>{$sum.performance_revenue|default="0.00"}</td>
|
||||
<td>{$sum.appraisal_bonuses|default="0.00"}</td>
|
||||
<td>{$sum.company_profit|default="0.00"}</td>
|
||||
<td>{$sum['performance_commission']|default='0.00'}</td>
|
||||
<td>{$sum['achievement_bonus']|default='0.00'}</td>
|
||||
<td>{$sum['commission']|default='0.00'}</td>
|
||||
<td>{$sum['extend_commission']|default='0.00'}</td>
|
||||
<td>{$sum['wait_commission']|default='0.00'}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<else/>
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</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 type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('MarketPercentage/personMarketStaffSettle')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
|
||||
var start = $("#time_start").val();
|
||||
var end = $("#time_end").val();
|
||||
if(start !='' && end != ''){
|
||||
if (Date.parse(start) > Date.parse(end)){
|
||||
layer.msg('开始时间必须小于等于结束时间');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*发放提成*/
|
||||
$('.send').click(function(){
|
||||
var time = $(this).attr('data-time');
|
||||
var admin_id = $(this).attr('data-admin_id');
|
||||
|
||||
layer.confirm('是否确认发放提成!', {
|
||||
title:'发放提成?',
|
||||
icon:0,
|
||||
closeBtn:0,
|
||||
btn: ['发放','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('sendBonus')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {pay_time:time,admin_id:admin_id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('#time_start').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
})
|
||||
|
||||
$('.send_back').click(function(){
|
||||
var time = $(this).attr('data-time');
|
||||
var admin_id = $(this).attr('data-admin_id');
|
||||
|
||||
layer.confirm('是否确认发放提成!', {
|
||||
title:'发放提成?',
|
||||
icon:0,
|
||||
closeBtn:0,
|
||||
btn: ['发放','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('sendBonus')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {pay_time:time,admin_id:admin_id,all:1},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('.recaculate').click(function(){
|
||||
var url = $(this).attr('url');
|
||||
layer.confirm('是否确认重算提成!', {
|
||||
title:'重算提成?',
|
||||
icon:0,
|
||||
btn: ['重算','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success:function(data){
|
||||
if(data.status == 1) {
|
||||
layer.msg("重新计算需要时间,请等待5分钟后再查看");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.info);
|
||||
}
|
||||
},
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
var checked = 'checked';
|
||||
|
||||
|
||||
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
$(".jsgamecheckall").attr('checked',false);
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
checked = '';
|
||||
}
|
||||
}
|
||||
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").attr('checked',checked);
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
var tip_msg = res.info ? res.info : '操作失败';
|
||||
layer.msg(tip_msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,479 @@
|
||||
<extend name="Public/base"/>
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
|
||||
<script src="__STATIC__/jquery.form.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.layui-layer-dialog .layui-layer-content{color:red}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">提成数据汇总表</h3>
|
||||
<!-- <p class="description_text">说明:此功是查看并管理推广员的功能</p>-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
<div class="fl button_list">
|
||||
<div class="tools">
|
||||
<empty name="show_status">
|
||||
<a class="recaculate" url="{:U('reCaculateBonus?pay_time='.$_GET['pay_time'])}"><span class="button_icon button_icon1"></span>重算</a>
|
||||
</empty>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<!-- <div class="input-list input-list-promote search_label_rehab">-->
|
||||
<!-- <select id="pay_time" name="pay_time" class="select_gallery" style="width:150px;">-->
|
||||
<!-- <option value="">请选择月份</option>-->
|
||||
<!-- <volist name=":getMonth()" id="vo">-->
|
||||
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['pay_time']">selected=selected</if>>{$vo}</option>-->
|
||||
<!-- </volist>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="input-list">
|
||||
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
|
||||
-
|
||||
<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>
|
||||
<volist name=":getMarketAdmin()" id="vo">
|
||||
<option value="{$vo.real_name}" <if condition="$vo.real_name eq $_GET['real_name']">selected=selected</if>>{$vo.real_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="nickname" name="nickname" class="select_gallery" style="width:120px;">
|
||||
<option value="">请选择账号</option>
|
||||
<volist name=":getMarketAdmin()" id="vo">
|
||||
<option value="{$vo.nickname}" <if condition="$vo.nickname eq $_GET['nickname']">selected=selected</if>>{$vo.nickname}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="level" name="level" class="select_gallery" style="width:120px;">
|
||||
<option value="" selected="">请选择级别</option>
|
||||
<option value="21" <if condition="$_GET['level'] eq 1">selected</if>>初级</option>
|
||||
<option value="11" <if condition="$_GET['level'] eq 2">selected</if>>中级</option>
|
||||
<option value="12" <if condition="$_GET['level'] eq 2">selected</if>>高级</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="" value="" class="sortBy">
|
||||
<input type="hidden" name="type" value="{$_GET['type']}">
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('showBonusList','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<empty name="show_status">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>姓名</th>
|
||||
<th>账号</th>
|
||||
<th>级别</th>
|
||||
<th>总流水</th>
|
||||
<th>总提成</th>
|
||||
<th>已发放总提成</th>
|
||||
<th >剩余未发放总提成</th>
|
||||
<th >操作备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<if condition = "empty($list_data)">
|
||||
<tr>
|
||||
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<notemtpy name = "list_data">
|
||||
<volist name="list_data" id="data">
|
||||
<tr>
|
||||
<td>{$data.real_name}</td>
|
||||
<td>{$data.nickname}</td>
|
||||
<td>{$data.level}</td>
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$start_time,'time_end'=>$end_time,'admin_id'=>$data['admin_id']))}" >{$data.pay_amount}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end'],'admin_id'=>$data['admin_id']))}" >{$data.commission}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end'],'admin_id'=>$data['admin_id'],'status'=>1))}" >{$data['extend_commission']}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end'],'admin_id'=>$data['admin_id'],'status'=>0))}" >{$data['wait_commission']}</a></td>
|
||||
<td>{$data['remark']}</td>
|
||||
</tr>
|
||||
</volist>
|
||||
<td colspan="3">合计</td>
|
||||
<td><a href="{:U('FinancePromote/index',array('time_start'=>$start_time,'time_end'=>$end_time))}" >{$sum['pay_amount']|default="0.00"}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end']))}" >{$sum['commission']|default="0.00"}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end'],'status'=>1))}" >{$sum['extend_commission']|default='0.00'}</a></td>
|
||||
<td><a href="{:U('MarketPercentage/personMarketStaffSettle',array('time_start'=>$_REQUEST['time_start'],'time_end'=>$_REQUEST['time_end'],'status'=>0))}" >{$sum['wait_commission']|default='0.00'}</a></td>
|
||||
<td></td>
|
||||
</notemtpy>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<else/>
|
||||
</empty>
|
||||
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
</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}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('MarketPercentage/showBonusList')}');
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
|
||||
var start = $("#time_start").val();
|
||||
var end = $("#time_end").val();
|
||||
if(start !='' && end != ''){
|
||||
if (Date.parse(start) > Date.parse(end)){
|
||||
layer.msg('开始时间必须小于等于结束时间');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
$(".paixu").click(function(){
|
||||
var that=$(this);
|
||||
$data_order=that.attr('data-order');
|
||||
$order_type='{$userarpu_order}';
|
||||
if($order_type==''||$order_type=='4'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='3,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}else if($order_type=='3'){
|
||||
$(".sortBy").attr('name','data_order');
|
||||
val='4,'+$data_order;
|
||||
$(".sortBy").attr('value',val);
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
$("#admin").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$(this).find('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#admin #i_list_id').on('keyup',function(event) {
|
||||
var val = $.trim($(this).val()).toLowerCase();
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(val);
|
||||
});
|
||||
|
||||
$("#admin #i_list_li").find("a").each(function(){
|
||||
$(this).click(function(){
|
||||
var text = $.trim($(this).text()).toLowerCase();
|
||||
$(this).closest('.drop-down').find("#i_list_id").val(text);
|
||||
$(this).closest('.drop-down').find('#i_list_idh').val(text);
|
||||
})
|
||||
});
|
||||
|
||||
//下拉内容框
|
||||
$(".drop-down2").on('click',function(event) {
|
||||
var navlist = $(this).find('.i_list_li');
|
||||
if (navlist.hasClass('hidden')) {
|
||||
navlist.removeClass('hidden');
|
||||
$('#i_list_id').focus().val('');
|
||||
} else {
|
||||
navlist.addClass('hidden');
|
||||
}
|
||||
$(document).one("click", function(){
|
||||
navlist.addClass('hidden');
|
||||
});
|
||||
event.stopPropagation();
|
||||
});
|
||||
/* 状态搜索子菜单 */
|
||||
/*渠道删除*/
|
||||
$('.delete').click(function(){
|
||||
var id = $(this).attr('data-id');
|
||||
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
|
||||
title:'确定要删除该渠道?',
|
||||
icon:0,
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('del_promote')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('#time_start').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
});
|
||||
|
||||
$('#datetimepicker').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language:"zh-CN",
|
||||
// minView:2,
|
||||
weekStart: 1,
|
||||
todayBtn: true,
|
||||
todayHighlight: false,
|
||||
startView: 3,
|
||||
minView: 3,
|
||||
forceParse: 0,
|
||||
autoclose:true,
|
||||
pickerPosition:'bottom-left'
|
||||
})
|
||||
|
||||
$('.recaculate').click(function(){
|
||||
var url = $(this).attr('url');
|
||||
layer.confirm('是否确认重算提成!', {
|
||||
title:'重算提成?',
|
||||
icon:0,
|
||||
btn: ['重算','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success:function(data){
|
||||
if(data.status == 1) {
|
||||
layer.msg("重新计算需要时间,请等待5分钟后再查看");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
} else {
|
||||
layer.msg(data.info);
|
||||
}
|
||||
},
|
||||
});
|
||||
}, function(){
|
||||
layer.close();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击字母按照条件按钮筛选
|
||||
$(".pro_promot_select_list_con").click(function(){
|
||||
//选中高亮样式
|
||||
$(this).addClass('active');
|
||||
$(this).siblings().removeClass('active');
|
||||
|
||||
var that = $(this);
|
||||
var index = $(this).attr("data-index");
|
||||
|
||||
$("#game_list li").each(function(index,ele){
|
||||
var short = $(this).attr('data-short');
|
||||
$(this).show();
|
||||
if(that.attr('data-index')){
|
||||
if(that.attr('data-index')!=short.charAt(0)){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//打开弹窗
|
||||
$(".ajax-view").click(function(){
|
||||
//获取游戏列表
|
||||
var url = "{:U('Promote/getPromoteGame')}";
|
||||
var id = $(this).attr('data-id');
|
||||
var checked = 'checked';
|
||||
|
||||
|
||||
|
||||
$.post(url,{id:id},function(res){
|
||||
if(res.code==1){
|
||||
|
||||
$(".pro_promot_select_list a").eq(0).addClass('active');
|
||||
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
|
||||
|
||||
var game_list = res.data.game_list;
|
||||
var promote_info = res.data.promote_info;
|
||||
var lis = [];
|
||||
|
||||
$.each(game_list,function(index,ele){
|
||||
if(ele.game_name.length>6){
|
||||
ele.game_name = ele.game_name .substring(0,6)+"..."
|
||||
}
|
||||
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
|
||||
|
||||
|
||||
if(promote_info['game_ids']==''){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
if(promote_info['game_ids'].indexOf(ele.id)>-1){
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
|
||||
}else{
|
||||
$(".jsgamecheckall").attr('checked',false);
|
||||
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
|
||||
checked = '';
|
||||
}
|
||||
}
|
||||
|
||||
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
|
||||
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
|
||||
lis.push('</li>');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").attr('checked',checked);
|
||||
|
||||
$("#game_list").html(lis.join(''));
|
||||
$(".pro_promot_number").text(res.data.promote_info.account);
|
||||
$("#se_promote_id").val(res.data.promote_info.id);
|
||||
$(".pro_promot").css("display","block");
|
||||
|
||||
jsgameid();
|
||||
|
||||
}else{
|
||||
var tip_msg = res.info ? res.info : '操作失败';
|
||||
layer.msg(tip_msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存修改
|
||||
$(".pro_promot_btn_confirm").click(function(){
|
||||
$("#ajaxForm").ajaxSubmit(function(res){
|
||||
layer.msg(res.msg);
|
||||
$(".pro_promot").hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//关闭弹窗
|
||||
$(".pro_promot_close").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
});
|
||||
//取消修改
|
||||
$(".pro_promot_btn_cancel").click(function(){
|
||||
$(".pro_promot").css("display","none");
|
||||
layer.msg('修改已取消');
|
||||
});
|
||||
|
||||
$(".jsgamecheckall").click(function(){
|
||||
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
|
||||
});
|
||||
|
||||
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
|
||||
function jsgameid(){
|
||||
$(".jsgameid").click(function(){
|
||||
var option = $(this).closest('ul').find(".jsgameid"),
|
||||
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
|
||||
option.each(function(i){
|
||||
if(!this.checked){
|
||||
checkall.prop("checked", false);
|
||||
return false;
|
||||
}else{
|
||||
checkall.prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</block>
|
Loading…
Reference in New Issue