冲突解决

master
yulingwei 5 years ago
commit e26f517df1

@ -2113,4 +2113,27 @@ function check_str($str, $substr)
return $nums;
}
function getPromoteGameRatio($promoteID = 0, $relationGameId = 0, $amount=0, $timeStart=0, $timeEnd=0, $isDefault = false)
{
$map = " promote_id = {$promoteID} and relation_game_id = {$relationGameId} and status = 1 and begin_time <= {$timeStart} ";
if ($timeEnd) {
$map .= " and (end_time = 0 or end_time >= {$timeEnd}) ";
}
$result = M('promote_game_ratio_log', 'tab_')->where($map)->order('id desc')->find();
if (!$result) return 0;
$ratios = array_reverse(json_decode($result['turnover_ratio'], true));
if (!$ratios) return 0;
if ($isDefault) {
return $result['ratio'] ?: 0;
}
$ratio = $result['ratio'];
foreach ($ratios as $item) {
if (($item['instanceof'] == 1 && $amount >= $item['turnover']) || ($item['instanceof'] == 2 && $amount > $item['turnover'])) {
$ratio = $item['ratio'];
break;
}
}
return $ratio;
}
?>

@ -48,7 +48,8 @@ class AdminController extends Controller {
if ( false === $access ) {
$this->error('403:禁止访问');
}elseif(null === $access ){
if(CONTROLLER_NAME !== "Ajax"){//ajax放行
$access_controller = ['Ajax', 'Finance', 'FinancePromote', 'PayChannel'];
if(!in_array(CONTROLLER_NAME, $access_controller)){//ajax放行
//检测访问权限
$rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME);
if($rule == "admin/statistics/overview"||$rule == "admin/spend/lists"){//第一级菜单单独判断

@ -191,6 +191,10 @@ class AjaxController extends ThinkController{
foreach ($data as &$item) {
$item['nickname'] = $item['account'] . ($item['nickname'] ? "({$item['nickname']})" : "");
}
if($company_id <= 0){
array_unshift($data,["id"=>0,"nickname"=>"官方渠道","account"=>"官方渠道","company_id"=>0]);
}
$this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>$data]);
}

@ -10,7 +10,7 @@ use User\Api\UserApi as UserApi;
class DepositController extends ThinkController {
const model_name = 'Deposit';
public function lists(){
public function lists($p = 1){
if(isset($_REQUEST['user_account'])){
$map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
unset($_REQUEST['user_account']);
@ -38,16 +38,10 @@ class DepositController extends ThinkController {
}else if(isset($_REQUEST['promote_id']) && $_REQUEST['promote_id']==0){
$map['promote_id']=array('elt',0);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}elseif(isset($_REQUEST['promote_name'])&&$_REQUEST['promote_id']==-1){
$map['promote_id']=get_promote_id($_REQUEST['promote_name']);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}else{
$map['promote_id']=$_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
$map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
@ -94,6 +88,47 @@ class DepositController extends ThinkController {
$map1=$map;
$map1['pay_status']=1;
// if($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
// $page = intval($p);
// $page = $page ? $page : 1; //默认显示第一页数据
// if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
// $map1['order_status'] = 1;
// unset($map1['pay_status']);
// if ($map['pay_status']) {
// $map['order_status']=$map['pay_status'];
// }
//
// $total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
// $ttotal=null_to_0(D('coin_pay_order')->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
// $ytotal=null_to_0(D('coin_pay_order')->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
// $this->assign('total',$total);
// $this->assign('ttotal',$ttotal);
// $this->assign('ytotal',$ytotal);
//
// $data = D('coin_pay_order')
// /* 查询指定字段,不指定则查询所有字段 */
// ->field('*,order_status as pay_status')
// // 查询条件
// ->where($map)
// /* 默认通过id逆序排列 */
// ->order("id desc")
// /* 数据分页 */
// ->page($page, $row)
// /* 执行查询 */
// ->select();
//
// /* 查询记录总数 */
// $count = D('coin_pay_order')->where($map)->count();
//
// $page = set_pagination($count,$row);
// if($page) {$this->assign('_page', $page);}
//
// $this->assign('list_data', $data);
// $this->meta_title = '平台币充值列表';
// $this->display('lists');die();
// }
$total=null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
$ttotal=null_to_0(D(self::model_name)->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
$ytotal=null_to_0(D(self::model_name)->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
@ -105,9 +140,122 @@ class DepositController extends ThinkController {
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Deposit/lists','status'=>1])->find());
$this->assign("is_admin",is_administrator());
parent::lists(self::model_name,$_GET["p"],$map);
}
public function lists_secord() {
if(isset($_REQUEST['user_account'])){
$map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
unset($_REQUEST['user_account']);
}
if(isset($_REQUEST['order_number'])){
$map['order_number']=array('like','%'.trim($_REQUEST['order_number']).'%');
unset($_REQUEST['order_number']);
}
if(isset($_REQUEST['pay_ip'])){
$map['pay_ip']=array('like','%'.trim($_REQUEST['pay_ip']).'%');
unset($_REQUEST['pay_ip']);
}
setPowerPromoteIds($map,'promote_id');
if(!isset($_REQUEST['promote_id'])){
}else if(isset($_REQUEST['promote_id']) && $_REQUEST['promote_id']==0){
$map['promote_id']=array('elt',0);
}elseif(isset($_REQUEST['promote_name'])&&$_REQUEST['promote_id']==-1){
$map['promote_id']=get_promote_id($_REQUEST['promote_name']);
}else{
$map['promote_id']=$_REQUEST['promote_id'];
}
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
$map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
unset($_REQUEST['time-start']);unset($_REQUEST['time-end']);
}elseif(isset($_REQUEST['time-start'])){
$map['create_time'] = ['GT',strtotime(I('time-start'))];
unset($_REQUEST['time-start']);
}elseif(isset($_REQUEST['time-end'])){
$map['create_time'] = ['LT',strtotime(I('time-end'))+86399];
unset($_REQUEST['time-end']);
}
if(isset($_REQUEST['start'])&&isset($_REQUEST['end'])){
$map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
unset($_REQUEST['start']);unset($_REQUEST['end']);
}elseif(isset($_REQUEST['start'])){
$map['create_time'] = ['GT',strtotime(I('start'))];
unset($_REQUEST['start']);
}elseif(isset($_REQUEST['end'])){
$map['create_time'] = ['LT',strtotime(I('end'))+86399];
unset($_REQUEST['end']);
}
if(isset($_REQUEST['pay_way'])) {
if ($_REQUEST['pay_way'] == "2") {
$map['pay_way'] = ['in', '2,3,4'];
} else {
$map['pay_way'] = $_REQUEST['pay_way'];
}
unset($_REQUEST['pay_way']);
}
if(isset($_REQUEST['pay_status'])){
$map['pay_status']=$_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
if($_REQUEST['data_order']!=''){
$data_order=reset(explode(',',$_REQUEST['data_order']));
$data_order_type=end(explode(',',$_REQUEST['data_order']));
$this->assign('userarpu_order',$data_order);
$this->assign('userarpu_order_type',$data_order_type);
$sort = $data_order==3?'desc':'asc';
$map['order'] = $data_order_type.' '.$sort;
}
$map1=$map;
$map1['pay_status']=1;
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
$map1['order_status'] = 1;
unset($map1['pay_status']);
if ($map['pay_status']) {
$map['order_status']=$map['pay_status'];
}
$total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
$ttotal=null_to_0(D('coin_pay_order')->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
$ytotal=null_to_0(D('coin_pay_order')->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
$this->assign('total',$total);
$this->assign('ttotal',$ttotal);
$this->assign('ytotal',$ytotal);
$data = D('coin_pay_order')
/* 查询指定字段,不指定则查询所有字段 */
->field('*,order_status as pay_status,order_number as pay_order_number')
// 查询条件
->where($map)
/* 默认通过id逆序排列 */
->order("id desc")
/* 数据分页 */
->page($page, $row)
/* 执行查询 */
->select();
/* 查询记录总数 */
$count = D('coin_pay_order')->where($map)->count();
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->assign("is_admin",is_administrator());
$this->assign('list_data', $data);
$this->meta_title = '平台币充值列表';
$this->display();die();
}
public function send_lists(){

@ -1259,16 +1259,10 @@ class ExportController extends Controller
} else if (isset($_REQUEST['promote_id']) && $_REQUEST['promote_id'] == 0) {
$map['promote_id'] = array('elt', 0);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} elseif (isset($_REQUEST['promote_name']) && $_REQUEST['promote_id'] == -1) {
$map['promote_id'] = get_promote_id($_REQUEST['promote_name']);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} else {
$map['promote_id'] = $_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1));
@ -1290,31 +1284,32 @@ class ExportController extends Controller
}
$map1 = $map;
$map1['pay_status'] = 1;
$total = D('Deposit')->where($map1)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$xlsCell = array(
array('pay_order_number', "订单号"),
array('user_account', "玩家账号"),
array('promote_account', L('Subordinate_channel')),
array('pay_amount', "充值平台币"),
array('pay_way', "充值方式", 'get_pay_way', '*'),
array('pay_ip', "充值ip"),
array('create_time', "充值时间"),
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
array('', "共计充值{$total}"),
);
$xlsData = D('Deposit')
->where($map)
->order('id DESC')
->select();
foreach ($xlsData as $key => $value) {
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
}
$total = D('Deposit')->where($map1)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$xlsCell = array(
array('pay_order_number', "订单号"),
array('user_account', "玩家账号"),
array('promote_account', L('Subordinate_channel')),
array('pay_amount', "充值平台币"),
array('pay_way', "充值方式", 'get_pay_way', '*'),
array('pay_ip', "充值ip"),
array('create_time', "充值时间"),
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
array('', "共计充值{$total}"),
);
$xlsData = D('Deposit')
->where($map)
->order('id DESC')
->select();
foreach ($xlsData as $key => $value) {
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
}
// dd($xlsData);
break;
case 9:
@ -2235,6 +2230,104 @@ class ExportController extends Controller
$xlsData[] = $re_data;
}
break;
case 26:
$xlsName = $xlsName?$xlsName:L('Platform_currency_recharge');
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', '%' . trim($_REQUEST['user_account']) . '%');
unset($_REQUEST['user_account']);
}
if (isset($_REQUEST['order_number'])) {
$map['order_number'] = array('like', '%' . trim($_REQUEST['order_number']) . '%');
unset($_REQUEST['order_number']);
}
if (isset($_REQUEST['pay_ip'])) {
$map['pay_ip'] = array('like', '%' . trim($_REQUEST['pay_ip']) . '%');
unset($_REQUEST['pay_ip']);
}
// $promoteRoot = getPowerPromoteIds();
// $data_empower_type = session('user_auth')['data_empower_type'];
//
// if ($promoteRoot) {
// $map['promote_id'] =array('in',$promoteRoot);
// } else if(!$promoteRoot&&$data_empower_type!=1){
// $map['id'] = array('lt',1);
// }
setPowerPromoteIds($map,'promote_id');
if (!isset($_REQUEST['promote_id'])) {
} else if (isset($_REQUEST['promote_id']) && $_REQUEST['promote_id'] == 0) {
$map['promote_id'] = array('elt', 0);
} elseif (isset($_REQUEST['promote_name']) && $_REQUEST['promote_id'] == -1) {
$map['promote_id'] = get_promote_id($_REQUEST['promote_name']);
} else {
$map['promote_id'] = $_REQUEST['promote_id'];
}
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1));
unset($_REQUEST['time-start']);
unset($_REQUEST['time-end']);
}
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1));
unset($_REQUEST['start']);
unset($_REQUEST['end']);
}
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
unset($_REQUEST['pay_way']);
}
if (isset($_REQUEST['pay_status'])) {
$map['pay_status'] = $_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
$map1 = $map;
$map1['pay_status'] = 1;
$map1['order_status'] = 1;
unset($map1['pay_status']);
if ($map['pay_status']) {
$map['order_status']=$map['pay_status'];
}
$total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$xlsCell = array(
array('pay_order_number', "订单号"),
array('promote_account', L('Subordinate_channel')),
array('pay_amount', "充值平台币"),
array('pay_way', "充值方式"),
array('create_time', "充值时间"),
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
array('', "共计充值{$total}"),
);
$xlsData = D('coin_pay_order')
/* 查询指定字段,不指定则查询所有字段 */
->field('*,order_status as pay_status,order_number as pay_order_number')
// 查询条件
->where($map)
/* 默认通过id逆序排列 */
->order("id desc")
/* 执行查询 */
->select();
// var_dump($xlsData);die();
foreach ($xlsData as $key => $value) {
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
if(!$xlsData[$key]['pay_way']) {
$xlsData[$key]['pay_way'] = '无';
} else {
$xlsData[$key]['pay_way'] = get_pay_way($xlsData[$key]['pay_way'],'*');
}
}
// dd($xlsData);
break;
default:
$xlsName = $xlsCell = $xlsData = [];

@ -2,7 +2,8 @@
namespace Admin\Controller;
class FinancePromoteController extends AdminController
{
public function _initialize(Type $var = null)
public $COMPANY_NAME = "万盟天下科技";
public function _initialize()
{
parent::_initialize();
// echo "<pre>";
@ -114,7 +115,7 @@ class FinancePromoteController extends AdminController
} else {
$v['company_belong']='内团';
}
if(empty($v['company_name'])) $v['company_name']= "万盟天下科技";
if(empty($v['company_name'])) $v['company_name']= $this->COMPANY_NAME;
if(empty($v['p_id'])) $v['p_id']= "0";
if(!array_key_exists('cash_count',$v)) $v['cash_count']=0;
if(!array_key_exists('balance_coin_count',$v)) $v['balance_coin_count']=0;
@ -308,7 +309,7 @@ class FinancePromoteController extends AdminController
foreach($senddata as $k=>$v){
$v['company_belong']?$v['company_belong']='外团':$v['company_belong']='内团';
if(empty($v['company_name'])) $v['company_name']= "万盟天下科技";
if(empty($v['company_name'])) $v['company_name']= $this->COMPANY_NAME;
if(empty($v['promote_account'])) $v['promote_account']= "官方渠道";
if(!array_key_exists('cash_count',$v)) $v['cash_count']=0;
if(!array_key_exists('balance_coin_count',$v)) $v['balance_coin_count']=0;
@ -434,6 +435,8 @@ class FinancePromoteController extends AdminController
}
if (isset($_REQUEST['export'])) {
data2csv($data,$title, array(
"company_name"=>"推广公司",
"account"=>"会长账号",
"partner_name"=>"合作公司",
"game_name"=>"游戏",
"cash_count"=>"游戏现金金额",
@ -585,16 +588,26 @@ class FinancePromoteController extends AdminController
->field("s.game_id,s.game_name,p.partner as partner_name,
SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count")
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,
IFNULL(company_name,'{$this->COMPANY_NAME}') company_name")
->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
->join("tab_promote promote ON s.promote_id = promote.id","left")
->join("tab_promote_company company ON promote.company_id = company.id","left")
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id')
->order("p_id asc,cash_count desc")
->where($map)
->group('s.game_id');
->group('p_id,game_id');
if ($row != 0) {
$query = $query->page($page,$row);
}
$data = $query->select();
// dump($data);die();
$data = $query->select(false);
$data = M()
->table("(".$data.") a")
->field("a.*,IFNULL(promote.account,'官方渠道') account")
->join("tab_promote promote ON a.p_id = promote.id","left")
->select();
return $data;
}
private function totalGameStatisticsData($map, $join = true)
@ -621,27 +634,15 @@ class FinancePromoteController extends AdminController
$map['pay_way'] = $_REQUEST['pay_way'];
$this->assign('pay_way', $map['pay_way']);
}
if (!empty($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
// if (!empty(I('partner_id'))&&empty(I("game_id"))) {
// $wherePartner = I('partner_id');
// $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
// $gameId = implode(',',array_column($gameId,'id'));
// $map['tab_spend.game_id'] = ['in',$gameId];
// }
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
// if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
// $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
// }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];
} elseif (isset($_REQUEST['time_start'])) {
@ -649,7 +650,6 @@ class FinancePromoteController extends AdminController
} elseif (isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399];
}
if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) {
$map['tab_spend.promote_id'] = $_REQUEST['promote_id'];
@ -725,8 +725,6 @@ class FinancePromoteController extends AdminController
$count = count($count);
$page = set_pagination($count,$row);
// $map['pay_game_status'] = 1;
$total_cost = D('spend')->sumSpend($map, 'cost');//订单金额合计
$total_pay_amount = D('spend')->sumSpend($map, 'pay_amount');//实付金额合计
@ -888,7 +886,7 @@ class FinancePromoteController extends AdminController
$pmap['company_id'] = $_REQUEST['company_id'];
//获取公司名称
if($pmap['company_id'] == 0){
$title .= "万盟天下科技-";
$title .= "{$this->COMPANY_NAME}-";
}else{
$gfflg = false;
$title .= (M('promote_company',"tab_")->field("company_name")->where("id = '{$pmap['company_id']}'")->find()['company_name'] . "-");
@ -921,9 +919,10 @@ class FinancePromoteController extends AdminController
$t_in = implode(',', array_column($promoter_ids, 'id'));
}
$map[$field] = ['in',$t_in];
}else{
$map[$field] = ['in',"-1"];
}
}
//判断是否有推广员
$level = 1;
if ($_REQUEST['promote_id'] != '') {
@ -939,7 +938,6 @@ class FinancePromoteController extends AdminController
}
}
}
// dd($map);
$_POST['promote_level'] = $level;
}

@ -204,16 +204,12 @@ class MemberController extends ThinkController
$v['login_time'] = date('Y-m-d H:i:s',$v['login_time']);
$v['lock_status'] = get_info_status($v['lock_status'],4);
$v['check_status'] = $v['check_status']==1 ? "正常" :"拉黑";
if($v['lock_status'] != '锁定') {
$v['lock_remark'] = '';
}
// dump($v['lock_status']);
// $data[$k] = $v;
}
// die();
$field = array(
"id"=>"账号ID","account"=>"玩家账号","promote_account"=>"所属推广员","balance"=>"账户平台币","recharge_total"=>"累计充值","gold_coin"=>"金币",
"vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间",
"small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间",
"device_number"=>"设备号","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态"
);
data2csv($data,"玩家_玩家列表",$field);

@ -70,8 +70,15 @@ class MsgController extends ThinkController{
}
$look= $model->where(['id'=>$ids])->find();
redirect("http://".$_SERVER['HTTP_HOST'] . '/admin.php?s=/Apply/and_lists/type/'.$look['sdk_version'].'/game_id/'.$look['game_id']);
switch($look['type']) {
case 1:
redirect("http://".$_SERVER['HTTP_HOST'] . '/admin.php?s=/Apply/and_lists/type/'.$look['sdk_version'].'/game_id/'.$look['game_id']);
break;
case 3:
redirect("http://".$_SERVER['HTTP_HOST'] . '/admin.php?s=/Settlement/sheetDetail/id/'.$look['game_id']);
break;
}

@ -1367,6 +1367,7 @@ class PromoteController extends ThinkController
'company_belong' => $promote_belong['company_belong'],
'company_relation' => $promote_belong['company_relation'],
'can_view_recharge' => $promote_belong['can_view_recharge'],
'account_type' => $promote_belong['company_type']
];
$res = M("promote", "tab_")
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")

@ -1668,6 +1668,7 @@ class QueryController extends ThinkController
$this->display();
}
public function getChannelStream() {
$map = [];

@ -0,0 +1,461 @@
<?php
namespace Admin\Controller;
/**
* 结算单
* @author ylw
*/
class SettlementController extends ThinkController
{
// 汇总结算单列表
public function sheetList($row = 10, $p = 1)
{
$map = [];
if (I('settlement_type')) {
$map['settlement_type'] = I('settlement_type');
}
if (I('settlement_time_type')) {
$map['settlement_time_type'] = I('settlement_time_type');
}
if (I('creater_id')) {
$map['creater_id'] = I('creater_id');
}
if (I('all_status')) {
$map['all_status'] = I('all_status');
}
if (I('create_time_start')) {
$map['_string'] = "create_time >= ".strtotime(I('create_time_start'));
}
if (I('create_time_end')) {
$map['_string'] = "create_time <= ".strtotime(I('create_time_end'));
}
$login_uid = is_login();
$list = M('settlement_sheet', 'tab_')->where($map)->page($p, $row)->order("if (audit_user ={$login_uid}, 0,1 ) and status = 3, all_status desc, create_time desc")->select();
$count = M('settlement_sheet', 'tab_')->where($map)->count();
if (!empty($list)) {
foreach ($list as &$item) {
switch ($item['settlement_type']) {
case '1':
$item['settlement_type_name'] = '上游结算单';
break;
case '2':
$item['settlement_type_name'] = '下游-内团结算单';
break;
case '3':
$item['settlement_type_name'] = '下游-外团结算单';
break;
case '4':
$item['settlement_type_name'] = '下游-个人结算单';
break;
}
switch ($item['settlement_time_type']) {
case '1':
$item['settlement_time_type_name'] = '周结';
break;
case '2':
$item['settlement_time_type_name'] = '月结';
break;
}
switch ($item['status']) {
case '1':
$item['status_name'] = '审核通过';
break;
case '2':
$item['status_name'] = '审核未通过';
break;
case '3':
$item['status_name'] = '待审核';
break;
}
$item['audit_users'] = json_decode($item['audit_users'], true);
}
}
$this->assign('admin_users', M('member')->field('uid, nickname')->select());
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('list_data', $list);
$this->display();
}
// 生成结算单 月结算补点 周结不算
public function generateSettlementSheet($settlement_type = 0, $settlement_time_type = 0, $time_start=0, $time_end = 0, $delete=0, $id=0, $action='')
{
$msg = '';
$this->assign(I(''));
$this->assign('action', $action);
if ($delete) {
$res = M('settlement_sheet', 'tab_')->where(['id'=>$id])->delete();
return $res ? $this->success('删除成功', '', true) : $this->success('删除失败', '', true);
}
$this->meta_title = '结算单管理';
if (empty($settlement_type)) {
$msg = '请选择汇总结算单类型';
}
if (empty($settlement_time_type)) {
$msg = '请选择结算方式';
}
$settlement_time = I('settlement_time', '');
if ($settlement_time_type == 1) {
$settlement_time = explode(' 至 ', $settlement_time);
if (count($settlement_time) != 2) {
$msg = '请选择正确的时间区间';
} else {
$time_start = strtotime($settlement_time[0]);
$time_end = strtotime($settlement_time[1]) + 3600 * 24 - 1;
}
} else {
$time_start = strtotime($settlement_time);
$time_end = strtotime('+1 month', $time_start) - 1;
}
if ($time_end > time()) {
$msg = "结算结算时间无法大于当前时间";
}
if (empty($time_start) || empty($time_end)) {
$msg = '请选择正确的时间区间';
}
if (IS_GET) {
// 判断结算时间是否冲突
$isExsist = M('settlement_sheet', 'tab_')->where(['settlement_type'=>$settlement_type, 'time_start'=>$time_start, 'time_end'=>$time_end, 'settlement_time_type'=>$settlement_time_type])->find();
if ($isExsist) {
$msg = "已存在此类型结算单";
}
// 生成结算单数据
$generate = false;
if (!$msg) {
$generate = true;
if ($settlement_type == 1) {
if ($settlement_time_type == 1) {
$map = " and p.settlement_type = 1";
} else {
$map = '';
}
$result = M('spend', 'tab_')->query("
SELECT
sum(s.pay_amount) as amount, g.relation_game_id, g.relation_game_name, p.partner, p.id as p_id, p.channel_rate, p.invoice_rate, g.id as game_id
FROM
tab_spend as s
INNER JOIN tab_game g on s.game_id = g.id
INNER JOIN tab_partner p on p.id = g.partner_id {$map}
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
GROUP BY relation_game_id, p.id
ORDER BY p_id asc");
$list = [];
foreach ($result as $key => $item) {
if (!isset($list[$item['p_id']])) {
// 奖罚金额
$reward = M('reward_record', 'tab_')
->field('sum(money) as money, reward_type')
->where("company_type = 1 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
->group('reward_type')
->select();
if (!empty($reward)) {
$reward = array_column($reward, 'money', 'reward_type');
}
$list[$item['p_id']] = [
'company_id'=>$item['p_id'],
'company_name'=>$item['partner'],
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
'channel_rate' => $item['channel_rate'], // 渠道费
'invoice_rate' => $item['invoice_rate'], // 税费
'time_start' => date('Y-m-d', $time_start),
'time_end' => date('Y-m-d', $time_end)
];
}
$data = [];
// 获取分成比例
if ($settlement_time_type == 1) {
$data['game_ratio'] = getGameCpRadio($item['game_id'], $item['amount'], false);
} else {
$data['game_ratio'] = getGameCpRadio($item['game_id'], $item['amount'], true);
}
$data['relation_game_id'] = $item['relation_game_id'];
$data['relation_game_name'] = $item['relation_game_name'];
$data['amount'] = $item['amount'];
$data['self_game_ratio'] = 100 - $data['game_ratio'];
$data['parter_settlement'] = $item['amount'] * $data['game_ratio']/100 - ($item['amount']*$item['channel_rate'] ) + $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
$list[$item['p_id']]['channels'][] = array_merge($data, [
'company_id'=>$item['p_id'],
'company_name'=>$item['partner'],
'bonuses'=>$list[$item['p_id']]['bonuses'],
'fine'=>$list[$item['p_id']]['fine'],
'channel_rate' => $item['channel_rate'],
'invoice_rate' => $item['invoice_rate']]);
}
} else if (\in_array($settlement_type, [2, 3])) {
$map = "p.account_type = 1 and p.`level` = 1 and p.company_belong " . ($settlement_type == 2 ? " = 0 " : " in (1, 2) ") ;
if ($settlement_time_type == 1) {
$map .= " and p.settlement_type = {$settlement_time_type} ";
}
$result = M()->query("
SELECT
p.id, p.account, pc.company_name, pc.id as p_id, pc.fax_ratio, pc.settlement_contact
FROM
tab_promote p
INNER JOIN tab_promote_company pc on p.company_id = pc.id
where {$map}
order by pc.id asc
");
$list = [];
foreach ($result as $key => $item) {
$res = M()->query("
select
g.relation_game_name, g.relation_game_id, sum(s.pay_amount) as amount
from
tab_spend s
inner join tab_promote p on p.chain like '/{$item['id']}/%' and s.promote_id = p.id
inner join tab_game g on s.game_id = g.id
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
group by g.relation_game_id
");
if ($res) {
if (!isset($list[$item['p_id']])) {
// 奖罚金额
$reward = M('reward_record', 'tab_')
->field('sum(money) as money, reward_type')
->where("company_type = 2 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
->group('reward_type')
->select();
if (!empty($reward)) {
$reward = array_column($reward, 'money', 'reward_type');
}
$list[$item['p_id']] = [
'company_id'=>$item['p_id'],
'company_name'=>$item['company_name'],
'fax_ratio' => $item['fax_ratio'],
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
'settlement_contact' => $item['settlement_contact'],
'create_time' => time(),
'time_start' => date('Y-m-d', $time_start),
'time_end' => date('Y-m-d', $time_end)
];
$list[$item['p_id']]['total_amount'] = $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
}
foreach ($res as $k => $val) {
$gameRatio = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, true);
if ($settlement_time_type == 2) {
$gameRatioMax = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, false);
} else {
$gameRatioMax = $gameRatio;
}
$price = $val['amount']*$gameRatioMax/100 - $val['amount']*$item['fax_ratio']/100;
$list[$item['p_id']]['channels'][] = [
'promote_id' => $item['id'],
'account'=>$item['account'],
'relation_game_name'=>$val['relation_game_name'],
'relation_game_id'=>$val['relation_game_id'],
'game_ratio'=>$gameRatio,
'game_ratio_max'=>$gameRatioMax-$gameRatio,
'price'=> $price,
'amount' => $val['amount']
];
$list[$item['p_id']]['total_amount'] += $price;
}
}
}
} else if ($settlement_type == 4) {
$map = "p.account_type = 2 and p.`level` = 1 " ;
if ($settlement_time_type == 1) {
$map .= " and p.settlement_type = {$settlement_time_type} ";
}
$result = M()->query("
SELECT
p.id, p.account, pc.company_name, pc.id as p_id, company_relation, p.admin_id, pc.bank_card, pc.bank_cardname, pc.bank_name, pc.bank_address
FROM
tab_promote p
INNER JOIN tab_promote_company pc on p.company_id = pc.id
where {$map}
order by pc.id asc
");
$list = [];
foreach ($result as $key => $item) {
$res = M()->query("
select
g.relation_game_name, g.relation_game_id, sum(s.pay_amount) as amount
from
tab_spend s
inner join tab_promote p on p.chain like '/{$item['id']}/%' and s.promote_id = p.id
inner join tab_game g on s.game_id = g.id
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
group by g.relation_game_id
");
if ($res) {
if (!isset($list[$item['p_id']])) {
// 奖罚金额
$reward = M('reward_record', 'tab_')
->field('sum(money) as money, reward_type')
->where("company_type = 2 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
->group('reward_type')
->select();
if (!empty($reward)) {
$reward = array_column($reward, 'money', 'reward_type');
}
$list[$item['p_id']] = [
'company_id'=>$item['p_id'],
'company_name'=>$item['company_name'],
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
'settlement_contact' => $item['settlement_contact'],
'bank_card' => $item['bank_card'],
'bank_address' => $item['bank_address'],
'create_time' => time(),
'time_start' => date('Y-m-d', $time_start),
'time_end' => date('Y-m-d', $time_end)
];
$list[$item['p_id']]['total_amount'] = $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
}
foreach ($res as $k => $val) {
$gameRatio = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, true);
if ($settlement_time_type == 2) {
$gameRatioMax = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, false);
} else {
$gameRatioMax = $gameRatio;
}
$price = $val['amount']*$gameRatioMax/100;
$list[$item['p_id']]['channels'][] = [
'promote_id' => $item['id'],
'account'=>$item['account'],
'relation_game_name'=>$val['relation_game_name'],
'relation_game_id'=>$val['relation_game_id'],
'game_ratio'=>$gameRatio,
'game_ratio_max'=>$gameRatioMax-$gameRatio,
'price'=> $price,
'amount' => $val['amount'],
'type_name' => '个人',
'company_relation_name' => $item['company_relation'] == 0 ? "自主开发及维护" : ($item['company_relation'] == 1 ? "只维护" : "无"),
'admin_name' => get_admin_nickname($item['admin_id']) ?: '无'
];
$list[$item['p_id']]['total_amount'] += $price;
}
}
}
} else {
$generate = false;
$msg = "请选择正确的结算单类型";
}
}
$this->assign("generate", $generate);
$this->assign('admin_users', M('member')->where(['status'=>1])->field('uid, nickname')->select());
$this->assign('listData', array_values($list));
$this->assign('msg', $msg);
$this->assign('settlement_type', $settlement_type);
$this->meta_title = '结算单管理';
$this->display();
} else {
// 判断结算时间是否冲突
if ($msg) {
return $this->error($msg, true, true);
}
if ($id) {
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
if (!$info) {
return $this->error('未找到该记录');
}
} else {
if (\sizeof($_POST['settlement_sheet']) == 0) {
return $this->error('无法生成无记录的结算单', true, true);
}
$isExsist = M('settlement_sheet', 'tab_')->where(['settlement_type'=>$settlement_type, 'time_start'=>$time_start, 'time_end'=>$time_end, 'settlement_time_type'=>$settlement_time_type])->find();
if ($isExsist) {
return $this->error('已存在此类型结算单', true, true);
}
$data['creater_id'] = is_login();
$data['create_time'] = time();
$data['orderid'] = $settlement_type.$settlement_time_type.date('YmdHis').$data['creater_id'].rand(1000, 9999);
$data['settlement_type'] = $settlement_type;
$data['settlement_time_type'] = $settlement_time_type;
$data['time_start'] = $time_start;
$data['time_end'] = $time_end;
$data['audit_users'] = json_encode($_POST['audit_users']);
$data['settlement_sheet'] = json_encode($_POST['settlement_sheet']);
$data['audit_user'] = $_POST['audit_users'][0];
$res = M('settlement_sheet', 'tab_')->add($data);
// 生成消息
$notice['user_id'] = $_POST['audit_users'][0];
$notice['content'] = "结算单汇总审核:有一个结算单待你审核,请尽快处理!";
$notice['type'] = 3;
$notice['status'] = 2;
$notice['create_time'] = time();
$notice['game_id'] = $res;
M('msg', 'tab_')->add($notice);
return $res ? $this->success('生成成功', true, true) : $this->error('生成失败', true, true);
}
}
}
public function sheetDetail($id=0)
{
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
if (!$info) {
return $this->error('未找到该记录');
}
$info['listData'] = json_decode($info['settlement_sheet'], true);
$info['audit_users'] = json_decode($info['audit_users']);
$login_uid = is_login();
$arr_index = array_search($login_uid, $info['audit_users']);
$audit_auth = true;
if ($arr_index === false) {
$audit_auth = false;
} else if ($arr_index + 1 != $info['step']) {
$audit_auth = false;
} else if ($arr_index + 1 == sizeof($info['audit_users']) && $info['status'] != 3) {
$audit_auth = false;
} else if ($info['status'] != 3) {
$audit_auth = false;
}
$this->assign(['audit_auth'=>$audit_auth]);
$this->assign($info);
$this->meta_title = '结算单管理';
$this->display();
}
public function auditSheet($id=0, $audit_type = 2, $remark = '' )
{
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
if (!$info) {
return $this->error('未找到该记录', true, true);
}
$info['audit_users'] = json_decode($info['audit_users']);
$login_uid = is_login();
$arr_index = array_search($login_uid, $info['audit_users']);
if ($arr_index === false) {
return $this->error('无权审核改结算单', true, true);
} else if ($arr_index + 1 != $info['step']) {
return $this->error('您已审核过此结算单', true, true);
} else if ($arr_index + 1 == sizeof($info['audit_users']) && $info['status'] != 3) {
return $this->error('该结算单已经审核完毕', true, true);
}
$is_last = ($info['setp'] + 1 >= sizeof($info['audit_users']));
$update['remark'] = $remark;
$update['status'] = $audit_type == 1 ? ($is_last ? 1 : 3) : 2;
$update['step'] = ($audit_type == 1 && !$is_last) ? $info['step'] + 1 : $info['step'];
$update['audit_user'] = $login_uid;
if ($audit_type == 1 && $is_last) {
$update['all_status'] = 1;
} else if ($audit_type == 2) {
$update['all_status'] = 2;
}
// 通知审核
if ($update['status'] == 3 && !$is_last) {
$notice['user_id'] = $info['audit_users'][$info['step']];
$notice['content'] = "结算单汇总审核:有一个结算单待你审核,请尽快处理!";
$notice['type'] = 3;
$notice['status'] = 2;
$notice['create_time'] = time();
$notice['game_id'] = $id;
M('msg', 'tab_')->add($notice);
}
$upt = M('settlement_sheet', 'tab_')->where(['id'=>$id])->save($update);
return $upt ? $this->success('审核成功', true, true) : $this->error('审核失败', true, true);
}
}

@ -717,12 +717,13 @@ AND UNIX_TIMESTAMP(
$map['tab_user.promote_id']=$map_list['promote_id'];
}
unset($map['promote_id']);
$map["FROM_UNIXTIME(register_time,'%Y-%m-%d')"] = $time;
//$map["FROM_UNIXTIME(,'%Y-%m-%d')"] = $time;
$map["register_time"] = ['between', [strtotime($time), strtotime($time)+86399]];
$login_time = strtotime("+1 day",strtotime($time));
$login_time_end = $login_time+86399;
$num = M('user','tab_')
->field('count(DISTINCT tab_user.id) as num')
$num_sql = M('user','tab_')
->field('tab_user.id')
->join("right join tab_user_login_record as ur on ur.user_id = tab_user.id
and ur.login_time between $login_time and $login_time_end")
->where($map)
@ -1279,9 +1280,11 @@ AND UNIX_TIMESTAMP(
$mapl['tab_user.promote_id']=$mapl['promote_id'];
unset($mapl['promote_id']);
$login_time = date('Y-m-d', strtotime("+1 day",strtotime($time)));
$login_start = strtotime($login_time);
$login_end = $login_start + 86399;
$num = $user
->field('count(DISTINCT tab_user.id) as num')
->join("right join tab_user_login_record as ur on ur.user_id = tab_user.id and FROM_UNIXTIME(ur.login_time,'%Y-%m-%d') = '{$login_time}'")
->join("right join tab_user_login_record as ur on ur.user_id = tab_user.id and ur.login_time between {$login_start} and {$login_end}")
->where($mapl)
->find();
if (!empty($data[$key]['register_num'])) {

@ -328,7 +328,6 @@ class StatementController extends ThinkController
}else{
$this->ajaxReturn(array("error"=>"database error","code"=>2000));
}
}
}

@ -0,0 +1 @@
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":2,"player":0,"money":0},"active":[{"time":"0:00","count":1},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}

@ -1960,36 +1960,46 @@ class UserModel extends Model{
*/
public function activeRankOnPromote($timestr,$fieldname='count',$promoteid='',$row=0,$ordermark='desc') {
$map['tab_user.promote_id']=array('gt',0);
$map['promote_id']=array('gt',0);
if ($promoteid[0]) {$map['tab_user.promote_id']=array('in',$promoteid);}
if ($promoteid[0]) {$map['promote_id']=array('in',$promoteid);}
$sql = $this->field('tab_user.promote_id,tab_promote.account as promote_account,tab_user.id')
->join('tab_promote on (tab_promote.id = tab_user.promote_id) ')
$sql = $this->field('promote_id,tab_user.id')
->where(['register_time'.$timestr,$map])
->select(false);
$mid = $this->field('tab_user.promote_id,tab_promote.account as promote_account,tab_user.id')
->join('tab_user_login_record as uu on tab_user.id = uu.user_id')
->join('tab_promote on(tab_user.promote_id = tab_promote.id)')
->union($sql)
->group('tab_user.promote_id,tab_user.id')
->where(['uu.login_time '.$timestr,$map])
->select(false);
$last = $this->table('('.$mid.') as a')->field('a.promote_id,a.promote_account,GROUP_CONCAT(a.id),count(a.id) as '.$fieldname)
->group('a.promote_id')->select(false);
// $mid = $this->field('tab_user.promote_id,tab_promote.account as promote_account,tab_user.id')
// ->join('tab_user_login_record as uu on tab_user.id = uu.user_id')
// ->join('tab_promote on(tab_user.promote_id = tab_promote.id)')
// ->union($sql)
// ->group('tab_user.promote_id,tab_user.id')
// ->where(['uu.login_time '.$timestr,$map])
// ->select(false);
$mid = M('user_login_record', 'tab_')->alias("uu")->field('uu.promote_id, uu.user_id as id')
->union($sql)
->group('uu.promote_id, uu.user_id')
->where(['uu.login_time '.$timestr,$map])
->select(false);
$last = $this->table('('.$mid.') as a')->field('a.promote_id,GROUP_CONCAT(a.id),count(a.id) as '.$fieldname)
->group('a.promote_id')->select(false);
if($row>0) {
$data = $this->table('('.$last.') as b')->limit($row)->order('b.'.$fieldname.' '.$ordermark)->select();
$data = $this->table('('.$last.') as b')->limit($row)->order('b.'.$fieldname.' '.$ordermark)->limit(10)->select();
} else {
$data = $this->table('('.$last.') as b')->order('b.'.$fieldname.' '.$ordermark)->select();
$data = $this->table('('.$last.') as b')->order('b.'.$fieldname.' '.$ordermark)->limit(10)->select();
}
}
if (!empty($data)) {
$promoters = M('promote', 'tab_')->field('id, account')->where(['id'=>['in', array_column($data, 'promote_id')]])->select();
$promoter_names = array_column($promoters, 'account', 'id');
foreach ($data as &$item) {
$item['promote_account'] = isset($promoter_names[$item['promote_id']]) ? $promoter_names[$item['promote_id']] : '';
}
}
return $data;
}
@ -2013,27 +2023,33 @@ class UserModel extends Model{
->where(['register_time'.$timestr,$map2])
->select(false);
$mid = $this->field('uu.game_id,game_name,tab_user.id')
->join('tab_user_login_record as uu on tab_user.id = uu.user_id')
->union($sql)
->group('uu.game_id,tab_user.id')
->where(['uu.login_time '.$timestr,$map])
->select(false);
// $mid = $this->field('uu.game_id,game_name,tab_user.id')
// ->join('tab_user_login_record as uu on tab_user.id = uu.user_id')
// ->union($sql)
// ->group('uu.game_id,tab_user.id')
// ->where(['uu.login_time '.$timestr,$map])
// ->select(false);
$mid = M('user_login_record', 'tab_')->alias("uu")->field('game_id,game_name,user_id as id')
->union($sql)
->group('uu.game_id, uu.user_id')
->where(['uu.login_time '.$timestr,$map])
->select(false);
$last = $this->table('('.$mid.') as a')->field('a.game_id,a.game_name,GROUP_CONCAT(a.id),count(a.id) as '.$fieldname)
->group('a.game_id')->select(false);
if($row>0) {
$data = $this->table('('.$last.') as b')->limit($row)->order('b.'.$fieldname.' '.$ordermark)->select();
$data = $this->table('('.$last.') as b')->limit($row)->order('b.'.$fieldname.' '.$ordermark)->limit(10)->select();
} else {
$data = $this->table('('.$last.') as b')->order('b.'.$fieldname.' '.$ordermark)->select();
}
$data = $this->table('('.$last.') as b')->order('b.'.$fieldname.' '.$ordermark)->limit(10)->select();
}
return $data;
}

@ -28,6 +28,10 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a class="tabchose" href="{:U('lists',array('type'=>1))}">平台币充值</a>
<a href="{:U('lists_secord',array('type'=>2))}">推广员充值</a>
</div>
<h3 class="page_title">平台币充值</h3>
<p class="description_text">说明:玩家充值平台币到账户的记录,不包含消费平台币的记录,如需查询平台币使用,请到游戏充值中查询</p>
</div>
@ -160,7 +164,7 @@
</if>
</td>
<td><span>{$data.pay_amount}</span></td>
<td>{:get_pay_way($data['pay_way'])}</td>
<td><if condition="$data['pay_way'] neq ''">{:get_pay_way($data['pay_way'])}<else/></if></td>
<td>{$data.pay_ip}</td>
<td>{:set_show_time($data['create_time'],'','pay')}</td>
<td>
@ -170,7 +174,7 @@
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<td style="text-indent:0;">
<br />
<if condition="$data['pay_status'] eq 0">

@ -0,0 +1,430 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<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;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a href="{:U('lists',array('type'=>1))}">平台币充值</a>
<a class="tabchose" href="{:U('lists_secord',array('type'=>2))}">推广员充值</a>
</div>
<h3 class="page_title">平台币充值</h3>
<p class="description_text">说明:玩家充值平台币到账户的记录,不包含消费平台币的记录,如需查询平台币使用,请到游戏充值中查询</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" id="search-input" name="order_number" class="" value="{:I('order_number')}"
placeholder="订单号"/>
</div>
<div class="input-list">
<input type="text" id="time-start" name="time-start" class="" value="{:I('time-start')|I('start')}"
placeholder="充值开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time-end" class="" value="{:I('time-end')|I('end')}"
placeholder="充值结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-spend search_label_rehab">
<select id="pay_way_id" name="pay_way" class="select_gallery" style="width:120px;">
<option value="">充值方式</option>
<volist name=":cash_pay_way()" id="vo">
<option value="{$vo.key}">{$vo.value}</option>
</volist>
</select>
</div>
<div class="sleft input-list input-list-spend">
<select name="pay_status" class="select_gallery" id="sel_order">
<option value="">订单状态</option>
<option value="1">充值成功</option>
<option value="0">下单未付款</option>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('Deposit/lists_secord','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div>
<table>
<!-- 表头 -->
<thead>
<tr>
<th>订单号</th>
<th>所属推广员</th>
<th>
<a class="paixu" data-order='pay_amount'>
充值平台币
</a>
</th>
<th>充值方式</th>
<th>
<a class="paixu" data-order='create_time'>
充值时间
</a>
</th>
<th>订单状态</th>
<!-- <th>操作</th>-->
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="list_data">
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="list_data" id="data">
<tr>
<td>{:$data['pay_order_number']}</td>
<td>
<if condition="$data['promote_account'] eq '自然注册'">
官方渠道
<else/>
<if condition="$is_admin eq true ">
{$data.promote_account}
<else />
{$data.promote_account|encryptStr}
</if>
</if>
</td>
<td><span>{$data.pay_amount}</span></td>
<td><if condition="$data['pay_way'] neq ''">{:get_pay_way($data['pay_way'])}<else/></if></td>
<td>{:set_show_time($data['create_time'],'','pay')}</td>
<td>
<if condition="$data['pay_status'] eq 1">
<span class="order_status_color">{:get_info_status($data['pay_status'],9)}</span>
<else/>
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<!-- <td style="text-indent:0;">-->
<!-- <br />-->
<!-- <if condition="$data['pay_status'] eq 0">-->
<!-- <a class="pay_repair" href="javascript:void(0);"-->
<!-- href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>-->
<!-- </if>-->
<!-- </td>-->
</tr>
</volist>
</empty>
<tr class="data_summary">
<td>汇总</td>
<td colspan="7">
当页充值:{:array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount'))}
今日充值:{$ttotal}
昨日充值:{$ytotal}
累计充值:{$total}元(此处只汇总充值成功的订单)
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>26,'xlsname'=>'平台币订单_推广员充值'),I('get.')))}">导出</a>
{$_page|default=''}
</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="Deposit/lists">
</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">
<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>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<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('Deposit/lists')}');
$(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();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
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');
$('#promoteid').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function () {
navlist.addClass('hidden');
});
event.stopPropagation();
});
var a = $('.i_list_li li a');
$('#promoteid').on('keyup', function (event) {
var val = $.trim($(this).val()).toLowerCase();
$('#promoteid').val(val);
$('#promoteidh').val(-1);
});
$('#promoteidlist').find("a").each(function () {
$(this).click(function () {
var text = $.trim($(this).text()).toLowerCase(),
val = $(this).attr('value');
$('#promoteid').val(text);
$('#promoteidh').val(val);
})
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down11 .nav-list li").find("a").each(function () {
var that = $(".drop-down11");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down12").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down12 .nav-list li").find("a").each(function () {
var that = $(".drop-down12");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevelOther')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
// '<option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>' +
'';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
})
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
//初始化select2单选
initSelect2WithSearch();
});
function initSelect2WithSearch() {
// $("#sel_order").select2({
// tags: true,
// placeholder: '订单状态',
// allowClear: false, //清空
// minimumResultsForSearch: Infinity, // 永久隐藏搜索框
// });
}
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'deposit'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
</script>
</block>

@ -95,6 +95,23 @@
<div class="input-list search-title-box">
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
</div>
<div class="input-list input-list-resway search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" style="width:150px;">
<option value="">请选择推广公司</option>
<volist name=":getPromoteCompany()" id="vo">
<option value="{$vo.id}" <if condition="I('company_id') && $vo.id eq I('company_id')">selected
</if> >{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择会长</option>
<option value="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>官方渠道</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
@ -126,10 +143,10 @@
</div>
</div>
<input type="hidden" name="from" value="{$_GET['from']}"/>
<input type="hidden" name="promote_id" value="{$_GET['promote_id']}"/>
<!-- <input type="hidden" name="from" value="{$_GET['from']}"/> -->
<!-- <input type="hidden" name="promote_id" value="{$_GET['promote_id']}"/> -->
<input type="hidden" name="promote_type" value="{$_GET['promote_type']}"/>
<input type="hidden" name="company_id" value="{$_GET['company_id']}"/>
<!-- <input type="hidden" name="company_id" value="{$_GET['company_id']}"/> -->
<input type="hidden" name="company_belong" value="{$_GET['company_belong']}"/>
<div class="input-list">
@ -150,6 +167,8 @@
<!-- 表头 -->
<thead>
<tr>
<th>推广公司</th>
<th>会长账号</th>
<th>合作公司</th>
<th >游戏</th>
@ -172,39 +191,41 @@
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
</style>
<if condition = "empty($data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<if condition = "empty($data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td >{$data.company_name}</td>
<td >{$data.account}</td>
<td >{$data.partner_name}</td>
<td >{$data.game_name}</td>
<td >{$data.cash_count}</td>
<td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>0,'promote_id'=>$data['p_id'],'game_id'=>$data['game_id'],p=>1,row=>10]))}">{$data.balance_coin_count}</td>
<td class="coin-detail" data-pay_type="-1" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>-1,'promote_id'=>$data['p_id'],'game_id'=>$data['game_id'],p=>1,row=>10]))}">
{$data.inside_cash_count}
</td>
<td >{$data.all_cash_count}</td>
<td >
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'promote_id'=>$data['p_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level]))}" >订单查看</a>
</td>
</tr>
</volist>
<tr>
<td >{$data.partner_name}</td>
<td >{$data.game_name}</td>
<td >{$data.cash_count}</td>
<td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>0,'game_id'=>$data['game_id'],p=>1,row=>10]))}">{$data.balance_coin_count}</td>
<td class="coin-detail" data-pay_type="-1" style="color: #0066cc;cursor: pointer" data-url="{:U('FinancePromote/gameCoinDetail',array_merge(I('get.'),['pay_way'=>-1,'game_id'=>$data['game_id'],p=>1,row=>10]))}">
{$data.inside_cash_count}
</td>
<td >{$data.all_cash_count}</td>
<td >
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level]))}" >订单查看</a>
<td colspan="4" ><span>总计</span></td>
<td ><span><if condition="$sumCash neq ''">{$sumCash}<else/>0</if></span></td>
<td><if condition="$sumBalance neq ''">{$sumBalance}<else/>0</if></td>
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td>
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['promote_level'=>1]))}" >订单查看</a>
</td>
</tr>
</volist>
<tr>
<td colspan="2" ><span>总计</span></td>
<td ><span><if condition="$sumCash neq ''">{$sumCash}<else/>0</if></span></td>
<td><if condition="$sumBalance neq ''">{$sumBalance}<else/>0</if></td>
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td>
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['promote_level'=>1]))}" >订单查看</a>
</td>
</tr>
</notemtpy>
</notemtpy>
</if>
</tbody>
</table>
</div>
@ -250,7 +271,7 @@
});
$('.page a:eq(1)').click(function () {
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
window.location.replace(href)
@ -348,6 +369,35 @@
}
})
}
var promote_id = "{:I('promote_id')}";
var company_id = "{:I('company_id')}";
function getPromotersByCompanyid() {
var company_id = $("#company_id option:selected").val();
if(!company_id){
company_id = -1;
}
$.ajax({
url: "{:U('Ajax/getPromotersByCompanyid')}",
type: "get",
data: { company_id:company_id},
dataType: 'json',
success: function (response) {
str = '<option value="">请选择会长</option>';
data = response.data;
for (var i in data) {
str += "<option value='" + data[i].id + "' " + (promote_id && data[i].id == promote_id ? 'selected' : '') + ">" + data[i].nickname + "</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
}
getPromotersByCompanyid();
$("#company_id").change(function(){
getPromotersByCompanyid();
})
// $("#game_name, #game_type").change(function(){
// get_partnet_list();
// });

@ -244,7 +244,7 @@
highlight_subnav('{:U("FinancePromote/index")}');
$(function(){
$('.page a:eq(1)').click(function () {
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
window.location.replace(href)

@ -307,7 +307,7 @@
window.location.replace(url);
// window.location.href = url;
});
$('.page a:eq(1)').click(function () {
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
window.location.replace(href)

@ -58,7 +58,7 @@
<td>{$data.id}</td>
<td>
<eq name="data.status" value="2">
<a href="{:U('looktoread',array('ids'=>$data['id'],'type'=>2))}" class="msg_content_color msg_content_underline">
<a href="{:U('looktoread',array('ids'=>$data['id'],'type'=>$data['type']))}" class="msg_content_color msg_content_underline">
</eq>
{$data.content}
</a>

@ -50,7 +50,7 @@
<tr>
<td class="l">会长账号:</td>
<td class="r">
<select id="promote_id" name="" class="select_gallery" style="width:120px;" disabled>
<select id="promote_id" name="promote_id" class="select_gallery" style="width:120px;">
<option value="">请选择会长账号</option>
<volist name=":promote_listsOther(1)" id="vo">
<option promote_id-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $data['promote_id']">selected=selected</if>>{$vo.account}</option>

@ -0,0 +1,559 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<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;}
.data_list table td{
text-indent:0;
}
.data_game_list table td{
line-height:1;
padding: 3px;
}
</style>
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
.bnt_add,.bnt_remove,.bnt_save{
height: 30px;
width: 20px;
font-size: 20px;
line-height: 10px;
color: #3399ff;
background: none;
border: none;
margin-left: 20px;
cursor: pointer;
}
.bnt_remove{
color: #F70909;
}
.bnt_save{
color: #4DB361;
}
</style>
<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;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
</div>
<div class="jssearch search_list fl cf">
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list input-list-game search_label_rehab">
<select id="settlement_type" name="settlement_type" class="select_gallery" <?php echo $generate ? 'disabled="disabled"' : ""?></select>>
<option value="">请选择结算单类型</option>
<option value="1" <?php echo $settlement_type === 1 ? "selected" : ''?>>上游-汇总结算单</option>
<option value="2" <?php echo $settlement_type === 2 ? "selected" : ''?>>下游-内团汇总结算单</option>
<option value="3" <?php echo $settlement_type === 3 ? "selected" : ''?>>下游-外团汇总结算单</option>
<option value="4" <?php echo $settlement_type === 4 ? "selected" : ''?>>下游-个人汇总结算单</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="settlement_time_type" name="settlement_time_type" class="select_gallery" <?php echo $generate ? 'disabled="disabled"' : ""?>>
<option value="">结算方式</option>
<option value="1" <?php $settlement_time_type === 1 ? "selected" : ''?>>周结</option>
<option value="2" <?php $settlement_time_type == 2 ? "selected" : ''?>>月结</option>
</select>
</div>
<div class="input-list" id="pay_time">
<input type="text" class="txt range-date" id="time" name="settlement_time" placeholder="结算时间" value="{$settlement_time}" <?php echo $generate ? 'disabled="disabled"' : ""?> style="width: 180px;" readonly="readonly">
</div>
<?php if (!$generate) :?>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="/admin.php?s=/settlement/generateSettlementSheet">生成</a>
</div>
<?php endif;?>
</div>
</div>
</div>
<?php if ($msg):?>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th style="width:10%;min-width:150px;">{$msg}</th>
</tr>
</thead>
</table>
</div>
</div>
<?php elseif ($settlement_type == 1):?>
<span style="color: red;">上游-汇总结算单</span>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th style="width:10%;min-width:150px;">平台</th>
<th>时间</th>
<th>游戏名称</th>
<th>平台流水</th>
<th>分成比例</th>
<th>我方比例</th>
<th>渠道费率</th>
<th>税费费率</th>
<th>合作方结算分成</th>
<th>违规罚款</th>
<th>奖励</th>
<th style="width:20%;min-width:150px;">备注</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>123</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['self_game_ratio']}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['channel_rate']*100}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['invoice_rate']*100}%</td>
<td>{$channel['parter_settlement']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}"><textarea class="remark-txt" style="height: 100%;width: 100%;" oninput="updateDataRemark({$index}, this)"></textarea></td>
</tr>
<?php else :?>
<tr>
<td>123</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['self_game_ratio']}%</td>
<td>{$channel['parter_settlement']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php elseif (in_array($settlement_type, [2, 3])):?>
<!-- 下游-内团/外团汇总结算单 -->
<span style="color: red;">下游-<?php echo $settlement_type == 2 ? "内团" : "外团"?>汇总结算单</span>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>排序</th>
<th style="width:10%;">平台</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 style="width:20%;min-width:150px;">备注</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>{$channel['account']}</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fax_ratio']*100}%</td>
<td>{$channel['price']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
<td>{$item['time_start']} 至 {$item['time_end']}</td>
<td rowspan="{:sizeof($item['channels'])}">备注</td>
</tr>
<?php else :?>
<tr>
<td>{$channel['account']}</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
<td>{$item['time_start']} 至 {$item['time_end']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php elseif ($settlement_type == 4):?>
<span style="color: red;">下游-个人汇总结算单</span>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>排序</th>
<th style="width:10%;min-width:150px;">公司名称</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>开户名</th>
<th>银行卡号</th>
<th>开户网点</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>{$channel['account']}</td>
<td>{$channel['admin_name']}</td>
<td>{$channel['company_relation_name']}</td>
<td>{$channel['type_name']}</td>
<td>{$channel['relation_game_name']}</td>
<td >{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_card']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_address']}</td>
</tr>
<?php else :?>
<tr>
<td>{$channel['account']}</td>
<td>{$channel['admin_name']}</td>
<td>{$channel['company_relation_name']}</td>
<td>{$channel['type_name']}</td>
<td>{$channel['relation_game_name']}</td>
<td >{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php endif;?>
<br>
<?php if ($generate):?>
<span>请选择审核人:</span>
<div>
<span class="audit_user">
<select class="first_audit">
<?php foreach ($admin_users as $admin):?>
<option value="{$admin['uid']}" >{$admin['nickname']}</option>
<?php endforeach;?>
</select>
<button type="button" class="bnt_save"></button>
</span>
<button type="button" class="bnt_add"></button>
<button type="button" class="bnt_remove"></button>
</div>
<div>
<button class="submit_btn" id="submit" type="submit" target-form="form-horizontal">
确认保存
</button>
<button class="submit_btn" onclick="javascript:history.back(-1)">
返回
</button>
</div>
<?php endif;?>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script 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>
<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/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>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
.layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
.layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
.layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
.layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
.layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
.layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('settlement/sheetList')}");
var data = {:json_encode($listData)};
$(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;
}
window.location.href = url;
});
// 提交
$('#submit').on('click', function(){
var first_audit_arr = [];
var first_audits = $('.first_audit');
if (first_audits.size() <= 0) {
layer.msg("请选择至少一名一级审核人")
return false;
} else {
$.each(first_audits, function(index, item){
first_audit_arr.push($(item).val());
});
}
$.ajax({
url:"{:U('settlement/generateSettlementSheet')}",
method:'POST',
dataType:'JSON',
data:{
settlement_sheet:data,
audit_users:first_audit_arr,
settlement_type : $('#settlement_type').val(),
settlement_time_type : $('#settlement_time_type').val(),
settlement_time : $('#time').val()
},
success:function(response){
layer.msg(response.info);
if (response.status != 0) {
window.location.href = "{:U('settlement/sheetList')}";
}
}
});
});
$(".bnt_add").bind("click",function(){
console.log(1)
var a = $(this).parent('div').children('.audit_user:last').clone();
//$(".user-account:last").after(a);
$(this).before(a);
});
$(document).on('click', '.bnt_remove', function(){
if ($(this).parent('div').find('.audit_user').size() == 1) {
return false;
}
$(this).parent('div').find('.audit_user:last').remove();
});
function setTimeByWeek() {
var defaultDate = $('#time').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('#time').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
onChange: function (selectedDates, dateStr, instance) {
if (dateStr.indexOf('至') === -1) {
var thisDate = new Date(Date.parse(dateStr));
if (thisDate.getDay() !== 1) {
layer.msg('请选择周一到周日');
return false;
}
} else {
var thisDate = dateStr.split(' 至 ');
var startDate = new Date(Date.parse(thisDate[0]));
if (startDate.getDay() !== 1 || Date.parse(thisDate[1]) / 1000 - Date.parse(thisDate[0]) / 1000 !== 518400) {
layer.msg('请选择周一到周日');
$('#time').val('');
return false;
}
}
}
});
}
function setTimeByMonth() {
$('#time').datetimepicker({
format: 'yyyy-mm',
language: "zh-CN",
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
startView: 'year',
minView:'year',
maxView:'year',
});
}
function resetTime() {
$('#time').remove();
var html = '<input type="text" class="txt range-date" id="time" name="settlement_time" placeholder="结算时间" value="" style="width: 180px;" readonly="readonly">';
$('#pay_time').html(html);
}
switch (parseInt("{:(I('settlement_time_type', 0))}")) {
case 1:
setTimeByWeek();
break;
case 2:
setTimeByMonth();
break;
}
$('#settlement_time_type').change(function () {
var settlementType = parseInt($(this).val());
switch (settlementType) {
case 1:
resetTime();
setTimeByWeek();
break;
case 2:
case 3:
resetTime();
setTimeByMonth();
break;
default:
break;
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
});
function updateDataRemark(index, obj)
{
data[index].remark = $(obj).val();
}
</script>
</block>

@ -0,0 +1,406 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<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;}
.data_list table td{
text-indent:0;
}
.data_game_list table td{
line-height:1;
padding: 3px;
}
</style>
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
.bnt_add,.bnt_remove,.bnt_save{
height: 30px;
width: 20px;
font-size: 20px;
line-height: 10px;
color: #3399ff;
background: none;
border: none;
cursor: pointer;
}
.bnt_remove{
color: #F70909;
}
.bnt_save{
color: #4DB361;
}
</style>
<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;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:该功能是用于录入工会所属的推广公司名称</p>
</div>
<div class="jssearch search_list fl cf">
<a class="sch-btn" href="javascript:history.back(-1)" >返回</a>
<?php if ($msg):?>
{$msg}
<?php elseif ($settlement_type == 1):?>
<div class="data_list data_game_list">
<span style="color: red;">上游-汇总结算单</span>
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th style="width:10%;min-width:150px;">平台</th>
<th>时间</th>
<th>游戏名称</th>
<th>平台流水</th>
<th>分成比例</th>
<th>我方比例</th>
<th>渠道费率</th>
<th>税费费率</th>
<th>合作方结算分成</th>
<th>违规罚款</th>
<th>奖励</th>
<th style="width:20%;min-width:150px;">备注</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>123</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['self_game_ratio']}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['channel_rate']*100}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['invoice_rate']*100}%</td>
<td>{$channel['parter_settlement']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['remark']}</td>
</tr>
<?php else :?>
<tr>
<td>123</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['self_game_ratio']}%</td>
<td>{$channel['parter_settlement']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php elseif (in_array($settlement_type, [2, 3])):?>
<!-- 下游-内团/外团汇总结算单 -->
<span style="color: red;">下游-<?php echo $settlement_type == 2 ? "内团" : "外团"?>汇总结算单</span>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>排序</th>
<th style="width:10%;">平台</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 style="width:20%;min-width:150px;">备注</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>{$channel['account']}</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fax_ratio']*100}%</td>
<td>{$channel['price']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
<td>{$item['time_start']} 至 {$item['time_end']}</td>
<td rowspan="{:sizeof($item['channels'])}">备注</td>
</tr>
<?php else :?>
<tr>
<td>{$channel['account']}</td>
<td>{$channel['relation_game_name']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
<td>{$item['time_start']} 至 {$item['time_end']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php elseif ($settlement_type == 4):?>
<span style="color: red;">下游-个人汇总结算单</span>
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>排序</th>
<th style="width:10%;min-width:150px;">公司名称</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>开户名</th>
<th>银行卡号</th>
<th>开户网点</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
<else />
<?php foreach ($listData as $index => $item): ?>
<?php foreach ($item['channels'] as $k => $channel): ?>
<?php if ($k == 0) :?>
<tr>
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
<td>{$channel['account']}</td>
<td>{$channel['admin_name']}</td>
<td>{$channel['company_relation_name']}</td>
<td>{$channel['type_name']}</td>
<td>{$channel['relation_game_name']}</td>
<td >{$channel['time_start']} 至 {$channel['time_end']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_card']}</td>
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_address']}</td>
</tr>
<?php else :?>
<tr>
<td>{$channel['account']}</td>
<td>{$channel['admin_name']}</td>
<td>{$channel['company_relation_name']}</td>
<td>{$channel['type_name']}</td>
<td>{$channel['relation_game_name']}</td>
<td >{$item['time_start']} 至 {$item['time_end']}</td>
<td>{$channel['amount']}</td>
<td>{$channel['game_ratio']}%</td>
<td>{$channel['game_ratio_max']}%</td>
<td>{$channel['price']}</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</empty>
</tbody>
</table>
</div>
</div>
<?php endif;?>
<br>
<?php if ($generate):?>
<span>请选择审核人:</span>
<div>
<span class="audit_user">
<select class="first_audit">
<?php foreach ($admin_users as $admin):?>
<option value="{$admin['uid']}" >{$admin['nickname']}</option>
<?php endforeach;?>
</select>
<button type="button" class="bnt_save"></button>
</span>
<button type="button" class="bnt_add"></button>
<button type="button" class="bnt_remove"></button>
</div>
<?php endif;?>
<div>
<h3>审核人:</h3>
<div>
<?php foreach ($audit_users as $index => $user_id):?>
<span>
{:get_admin_nickname($user_id)}
<?php if ($index + 1 < $step):?>
通过
<?php elseif ($index + 1 == $step) :?>
<?php echo $status == 1 ? "通过" : ($status == 2 ? "未通过" : "待审核")?>
<?php else:?>
待审核
<?php endif;?>
<?php if ($index < sizeof($audit_users) - 1):?><button type="button" class="bnt_save"></button><?php endif;?>
</span>
<?php endforeach;?>
</div>
<div style="margin-top:30px;">
<label>备注:</label>
<?php if ($audit_auth):?>
<textarea style="width: 400px;height: 200px;" id="remark">{$remark}</textarea>
<?php else :?>
<textarea style="width: 400px;height: 200px;" id="remark" disabled>{$remark}</textarea>
<?php endif;?>
</div>
<?php if ($audit_auth):?>
<div style="margin-top: 30px;">
<button class="submit_btn" id="submit" type="submit" target-form="form-horizontal" onclick="auditSettlement({$id}, 1)">
审核通过
</button>
<button class="submit_btn" target-form="form-horizontal" onclick="auditSettlement({$id}, 2)">
审核未通过
</button>
</div>
<?php endif;?>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script 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>
<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/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>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
.layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
.layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
.layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
.layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
.layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
.layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('settlement/sheetList')}");
function auditSettlement(id, audit_type)
{
$.ajax({
url : "{:U('settlement/auditSheet')}",
dataType:"JSON",
method:"POST",
data : {id:id, audit_type:audit_type, remark:$('#remark').val()},
success:function(response){
layer.msg(response.info);
if (response.status != 0) {
location.reload()
}
}
});
}
</script>
</block>

@ -0,0 +1,262 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<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}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</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">
<a class="confirm ajax-post" id="dtnn" target-form="ids" url="{:U('Member/delprovide')}"><span class="button_icon button_icon2 "></span>批量删除</a>
</div> -->
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="settlement_type" name="settlement_type" class="select_gallery">
<option value="">选择汇总结算单类型</option>
<option value="1" <?php echo I('settlement_type') == 1 ? "selected" : "" ?> >上游结算单</option>
<option value="2" <?php echo I('settlement_type') == 2 ? "selected" : "" ?> >下游-内团结算单</option>
<option value="3" <?php echo I('settlement_type') == 3 ? "selected" : "" ?>>下游-外团结算单</option>
<option value="4" <?php echo I('settlement_type') == 4 ? "selected" : "" ?>>下游-个人结算单</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="settlement_time_type" name="settlement_time_type" class="select_gallery">
<option value="">选择汇总结算单类型</option>
<option value="1" <?php echo I('settlement_time_type') == 1 ? "selected" : "" ?> >周结</option>
<option value="2" <?php echo I('settlement_time_type') == 2 ? "selected" : "" ?> >月结</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="all_status" name="all_status" class="select_gallery">
<option value="">申请状态</option>
<option value="1" <?php echo I('all_status') == 1 ? "selected" : "" ?> >审核通过</option>
<option value="2" <?php echo I('all_status') == 2 ? "selected" : "" ?> >审核未通过</option>
<option value="3" <?php echo I('statall_statusus') == 3 ? "selected" : "" ?> >待审核</option>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="create-time-start" name="create_time_start" class="" value="{:I('create_time_start')}"
placeholder="申请开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="create-time-end" name="create_time_end" class="" value="{:I('create_time_end')}"
placeholder="申请结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="creater_id" name="creater_id" class="select_gallery" >
<option value="">选择申请人</option>
<?php foreach ($admin_users as $user):?>
<option value="{$user['uid']}" <?php if ($user['uid'] == I('creater_id')):?>selected<?php endif;?> >{$user['nickname']}</option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('settlement/sheetList','model='.$model['name'],false)}">
搜索
</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" href="{:U('settlement/generateSettlementSheet')}">
生成报销单
</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<!-- <th class="">
<input class="check-all" type="checkbox">
</th> -->
<th>结算单单号</th>
<th>结算单类型</th>
<th>时间</th>
<th>结算方式</th>
<th>申请时间</th>
<th>申请人</th>
<th>审核状态</th>
<th>当前审核人</th>
<th>备注</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.orderid}</td>
<td>{$data.settlement_type_name}</td>
<td >{:date('Y-m-d', $data['time_start'])} - {:date('Y-m-d', $data['time_end'])}</td>
<td>{$data.settlement_time_type_name}</td>
<td>{$data.create_time|date='Y-m-d H:i:s',###}</td>
<td>{:get_admin_nickname($data['creater_id'])}</td>
<td>{$data.status_name}</td>
<td>{:get_admin_nickname($data['audit_users'][$data['step']-1])}</td>
<td>{$data.remark}</td>
<td>
<a href="{:U('settlement/sheetDetail',array('id'=>$data['id']))}">查看 </a>
<a class="ajax-get confirm" href="{:U('settlement/generateSettlementSheet',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</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="settlement/sheetList">
</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"></script>
<script 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>
<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/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>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
.layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
.layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
.layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
.layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
.layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
.layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('settlement/sheetList')}');
$(function () {
$(".select_gallery").select2();
//搜索功能
$("#search").click(function () {
var sdate = Date.parse($('#time-start').val()) / 1000;
var edate = Date.parse($('#time-end').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
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;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#create-time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
})
</script>
</block>

@ -155,6 +155,34 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">公钥</td>
<td class="r table_radio">
<input name="config[pub_secret]" type="text" value="{$alipay['pub_secret']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">私钥</td>
<td class="r table_radio">
<input name="config[pri_secret]" type="text" value="{$alipay['pri_secret']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>

@ -167,7 +167,6 @@ class SafeController extends BaseController{
$modelList = ['基础信息', $metaTitle];
$this->verifyPasswordView($modelList);
$ver_status = M('promote','tab_')->where(['id'=>$id])->getField('ver_status',true);
if($ver_status[0] == 1) {
//return $this->display('editModify');
$this->redirect('editModify');

@ -974,6 +974,31 @@ CREATE TABLE `tab_statement` (
KEY `link_phone` (`link_phone`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='cp/公会对账单';
-- 2020-01-02
-- 提现结算类型 cxj
ALTER TABLE `tab_withdraw`
ADD COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 3 COMMENT '结算类型1-周结 2-月结 3-管理员提现 4-推广员提现 5-其他';
-- 2020 01-03 cxj
ALTER TABLE `sys_file`
MODIFY COLUMN `mime` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件mime类型';
ALTER TABLE `tab_spend`
MODIFY COLUMN `selle_status` int(11) NOT NULL DEFAULT 0 COMMENT '渠道结算 0未结算1 结算',
MODIFY COLUMN `selle_ratio` double(5, 2) DEFAULT 0.00 COMMENT '渠道分成比例';
-- 2020 01-06 cxj
ALTER TABLE `tab_promote_game_ratio`
ADD COLUMN `turnover_ratio` varchar(2000) NOT NULL COMMENT '流水分成比例' AFTER `last_ratio_status`;
ALTER TABLE `tab_promote_game_ratio`
ADD COLUMN `last_turnover_ratio` varchar(2000) NOT NULL COMMENT '上次流水分成比例' AFTER `turnover_ratio`;
-- 2020 01-07 cxj
ALTER TABLE `tab_withdraw`
ADD COLUMN `game_ratio` varchar(5000) NOT NULL COMMENT '游戏提现实际分成比例';
ALTER TABLE `tab_withdraw`
MODIFY COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '结算类型1-周结 2-月结 9-其他';
-- 新增CP游戏分成比例表 2020-01-09 郑昌隆
@ -1188,6 +1213,11 @@ MODIFY COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '
MODIFY COLUMN `company_relation` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '工会关系0-自主开发及维护1-只维护 2 无' AFTER `company_belong`;
ADD COLUMN `company_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工会类型 1公司 2个人' AFTER `can_view_recharge`;
-- 2020-02-10 yulingwei 推广工会管理 新增属性类型
ALTER TABLE `tab_promote`
MODIFY COLUMN `company_belong` tinyint(1) NOT NULL DEFAULT 0 COMMENT '工会归属0-内团1-外团 2-分发联盟 3 无' AFTER `company_id`,
MODIFY COLUMN `company_relation` tinyint(1) NOT NULL DEFAULT 0 COMMENT '工会关系0-自主开发及维护1-只维护 2 无' AFTER `company_belong`;
-- 2020-02-10 cxj 推广提现--新增审核模式
ALTER TABLE `tab_withdraw`
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';
@ -1255,3 +1285,38 @@ CREATE TABLE `tab_test_order` (
`add_time` int(11) DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-10 yulingwei 预付款预警
CREATE TABLE `tab_partner_divide_warn` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '公司预警表',
`partner_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '公司ID',
`advance_amount` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '预付款',
`warming_amount` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '预警金额',
`phones` json DEFAULT NULL,
`warn_frequency` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '预警金额频率',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态 1正常 2删除',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`upt_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改时间',
`operater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-17 yulingwei 汇总结算单管理
CREATE TABLE `tab_settlement_sheet` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`orderid` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '订单ID (时间戳+adminid+4为随机数字)',
`settlement_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '结算类型 1 上游结算单 2 下游-内团结算单 3下游-外团结算单 4 下游-个人结算单',
`time_start` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '结算开始时间',
`time_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '结算结束时间',
`settlement_time_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '结算周期 1周结 2月结',
`settlement_sheet` json NOT NULL COMMENT '结算单',
`audit_users` json NOT NULL COMMENT '审核人员',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
`audit_user` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当前审核人',
`step` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '审核进度 123',
`status` tinyint(1) unsigned NOT NULL DEFAULT '3' COMMENT '订单审核状态 1审核通过 2审核未通过 3待审核通过',
`all_status` tinyint(1) unsigned NOT NULL DEFAULT '3' COMMENT '订单审核状态 1审核通过 2审核未通过 3待审核通过',
`creater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '申请人',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

@ -0,0 +1,135 @@
{
"id": "1392920",
"name": "project",
"font_family": "iconfont",
"css_prefix_text": "icon",
"description": "",
"glyphs": [
{
"icon_id": "577306",
"name": "方形未选中",
"font_class": "fangxingweixuanzhong",
"unicode": "e720",
"unicode_decimal": 59168
},
{
"icon_id": "577307",
"name": "方形选中-fill",
"font_class": "fangxingxuanzhongfill",
"unicode": "e721",
"unicode_decimal": 59169
},
{
"icon_id": "577313",
"name": "加号1",
"font_class": "jiahao1",
"unicode": "e727",
"unicode_decimal": 59175
},
{
"icon_id": "577315",
"name": "减号",
"font_class": "jianhao",
"unicode": "e729",
"unicode_decimal": 59177
},
{
"icon_id": "1718321",
"name": "返回",
"font_class": "fanhui",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "1718323",
"name": "更多",
"font_class": "gengduo",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "2674472",
"name": "返回",
"font_class": "fanhui1",
"unicode": "e625",
"unicode_decimal": 58917
},
{
"icon_id": "2674473",
"name": "关闭",
"font_class": "guanbi",
"unicode": "e624",
"unicode_decimal": 58916
},
{
"icon_id": "4765734",
"name": "plus-circle",
"font_class": "plus-circle",
"unicode": "e781",
"unicode_decimal": 59265
},
{
"icon_id": "4765972",
"name": "minus-square",
"font_class": "minus-square",
"unicode": "e796",
"unicode_decimal": 59286
},
{
"icon_id": "4765973",
"name": "plus-square",
"font_class": "plus-square",
"unicode": "e797",
"unicode_decimal": 59287
},
{
"icon_id": "4936531",
"name": "minus-square-fill",
"font_class": "minus-square-fill",
"unicode": "e84b",
"unicode_decimal": 59467
},
{
"icon_id": "4936538",
"name": "plus-square-fill",
"font_class": "plus-square-fill",
"unicode": "e84c",
"unicode_decimal": 59468
},
{
"icon_id": "6151304",
"name": "reply",
"font_class": "reply",
"unicode": "e82f",
"unicode_decimal": 59439
},
{
"icon_id": "6151371",
"name": "sort",
"font_class": "sort",
"unicode": "e842",
"unicode_decimal": 59458
},
{
"icon_id": "6151377",
"name": "sort-down",
"font_class": "sort-down",
"unicode": "e843",
"unicode_decimal": 59459
},
{
"icon_id": "6151384",
"name": "sort-up",
"font_class": "sort-up",
"unicode": "e844",
"unicode_decimal": 59460
},
{
"icon_id": "8776842",
"name": "search",
"font_class": "icon-test",
"unicode": "e63c",
"unicode_decimal": 58940
}
]
}
Loading…
Cancel
Save