Merge branch 'feature/juhe_sms' into feature/platfrom_aggregate_finance

# Conflicts:
#	Application/Admin/View/PromoteCompany/view.html
#	Data/update.sql
master
zhengyongxing 4 years ago
commit a8f4f16349

@ -1109,7 +1109,7 @@ function get_promote_parent_acc($promote_id){
$data = $Promote->field('account,parent_id,chain')->find($promote_id);
if(empty($data)){
return $data["account"]="官方渠道";exit;
return $data["account"]=C('OFFICIEL_CHANNEL');exit;
}
$chain = trim($data['chain'], '/');
if ($chain == '') {

@ -112,4 +112,5 @@ return array(
'TMPL_EXCEPTION_FILE' => MODULE_PATH.'View/Public/exception.html',// 异常页面的模板文件
/*默认公司名称*/
'DEFAULT_COMPANY'=>"海南万盟天下科技有限公司",
'OFFICIEL_CHANNEL'=>"江息网络"
);

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

@ -65,6 +65,7 @@ class BehaviorLogController extends ThinkController
// $data = M('pay_info', 'tab_')->field('tab_pay_info.id,tab_pay_info.user_account,extend,tab_pay_info.create_time,tab_pay_info.game_name,tab_pay_info.server_name,tab_pay_info.promote_account,tab_pay_info.order_id,tab_pay_info.game_player_id,tab_pay_info.game_player_name,price,tab_server.server_name')->join('LEFT JOIN tab_server on tab_pay_info.server_id = tab_server.server_num AND tab_pay_info.game_id = tab_server.game_id AND tab_pay_info.server_id <> 0')->where($map)->order('tab_pay_info.id DESC')->page($p, $row)->select();
$data = M('pay_info', 'tab_')->where($map)->order('id DESC')->page($p, $row)->select();
foreach($data as $k => $v) {
($data[$k]['promote_account']=='官方渠道'||$data[$k]['promote_account']=='自然注册')?($data[$k]['promote_account']=C('OFFICIEL_CHANNEL')):'';
if(empty($v['extend'])) {
$data[$k]['extend'] = $v['order_id'];
}
@ -141,9 +142,10 @@ class BehaviorLogController extends ThinkController
$re_data['pay_time'] = $order_detail['create_time'];
$re_data['payed_time'] = date("Y-m-d H:i:s", $order_detail['payed_time']);
}
($order_detail['promote_account']=='官方渠道'||$order_detail['promote_account']=='自然注册')?($re_data['promote_account']="江息网络"):($re_data['promote_account'] = $order_detail['promote_account']);
$re_data['extend'] = isset($order_detail['extend']) ? $order_detail['extend'] : '-';
$re_data['user_account'] = $order_detail['user_account'];
$re_data['promote_account'] = $order_detail['promote_account'];
// $re_data['promote_account'] = $order_detail['promote_account'];
$re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-';
$re_data['pay_amount'] = $order_detail['pay_amount'];
$re_data['pay_way'] = get_pay_way($order_detail['pay_way']);

@ -51,6 +51,10 @@ class BindRechargeRecordController extends ThinkController{
empty(I('pay_order_number')) || $map['pay_order_number'] = I('pay_order_number','');
$data = $model->getLists($map,"create_time desc",$p);
foreach($data as $key => $value) {
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$this->assign("data",$data);
//分页

@ -154,6 +154,7 @@ class ExportController extends Controller
->select();
foreach($xlsData as $value) {
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
$value['play_time'] = date("Y-m-d H:i:s",$value['play_time']);
mb_convert_variables('GBK', 'UTF-8', $value);
@ -1221,7 +1222,7 @@ class ExportController extends Controller
}
checkEncryptionAuth($value['user_account'],'spend_lists');
// $value['user_account'] = encryption($value['user_account']);
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['extend'] = $value['extend'].'`';
$value['pay_way'] = get_pay_way($value['pay_way']);
$value['pay_status'] = get_info_status($value['pay_status'],9);
@ -1346,6 +1347,8 @@ class ExportController extends Controller
checkEncryptionAuth($xlsData[$key]['user_account'],'deposit_lists');
($xlsData[$key]['promote_account']=='官方渠道'||$xlsData[$key]['promote_account']=='自然注册')?($xlsData[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
if ($value['pay_status'] == 1){
$xlsData[$key]['payed_time'] = date('Y-m-d H:i:s', $value['payed_time']);
@ -2028,6 +2031,7 @@ class ExportController extends Controller
$xlsData = M('pay_info', 'tab_')->where($map)->order('id DESC')->select();
foreach($xlsData as $k => $v) {
$xlsData[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
($xlsData[$k]['promote_account']=='官方渠道'||$xlsData[$k]['promote_account']=='自然注册')?($xlsData[$k]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
break;
$startDate = empty($params['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $params['timestart'];
@ -2280,9 +2284,10 @@ class ExportController extends Controller
$re_data['pay_time'] = set_show_time($order_detail['create_time']);
$re_data['payed_time'] = set_show_time($order_detail['payed_time']);
}
$re_data['extend'] = !empty($order_detail['extend']) ? $order_detail['extend'] : '-';
($order_detail['promote_account']=='官方渠道'||$order_detail['promote_account']=='自然注册')?($re_data['promote_account']="江息网络"):($re_data['promote_account'] = $order_detail['promote_account']);
$re_data['extend'] = !empty($order_detail['extend']) ? $order_detail['extend'] : '-';
$re_data['user_account'] = $order_detail['user_account'];
$re_data['promote_account'] = $order_detail['promote_account'];
// $re_data['promote_account'] = $order_detail['promote_account'];
$re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-';
$re_data['pay_amount'] = $order_detail['pay_amount'];
$re_data['pay_way'] = get_pay_way($order_detail['pay_way']);
@ -3620,7 +3625,7 @@ class ExportController extends Controller
->where($map)
->find();
}
$authorityData['promote_account'] = "官方渠道";
$authorityData['promote_account'] = C('OFFICIEL_CHANNEL');
$authorityData['id'] = "1";
if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) {
$authorityData = [];
@ -4158,6 +4163,9 @@ class ExportController extends Controller
$data = $data['data'];
foreach ($data as $key => $value) {
checkEncryptionAuth($data[$key]['user_account'],'BindRechargeRecordExport');
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
$data[$key]['pay_way'] = get_pay_way($value['pay_way']);
$data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
if ($value['pay_status'] == 1) {
@ -7241,10 +7249,10 @@ class ExportController extends Controller
$value['register_type'] = get_registertype($value['register_type']);
$value['top_promote'] = $value['parent_name']?$value['promote_account'].'['.$value['parent_name'].']':$value['promote_account'];
if (!$value['promote_account']) {
$value['top_promote'] = "官方渠道";
$value['top_promote'] = C('OFFICIEL_CHANNEL');
}
if($value['parent_name'] == "官方渠道") {
$value['top_promote'] = $value['promote_account'];
$value['top_promote'] = C('OFFICIEL_CHANNEL');
}
unset($value['promote_account']);
unset($value['parent_name']);

@ -854,6 +854,7 @@ class FinanceController extends ThinkController
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
if (isset($_REQUEST['export'])) {
checkEncryptionAuth($data[$key]['user_account'],'gameStatisticsDetail');

@ -120,6 +120,21 @@ class FinancePromoteController extends AdminController
if(!array_key_exists('bind_coin_count',$v)) $v['bind_coin_count']=0;
if(!array_key_exists('inside_cash_count',$v)) $v['inside_cash_count']=0;
$v['promote_account'] = get_promote_name($v['p_id']);
if ($v['admin_id']) {
$v['admin_id'] = get_admin_account($v['admin_id']);
} else {
$v['admin_id'] = '无';
}
if ($v['develop_type'] == 1) {
$v['develop_type'] = '自主开发';
} elseif($v['develop_type'] == 2) {
$v['develop_type'] = '自主开发及维护';
} elseif($v['develop_type'] == 3) {
$v['develop_type'] = '只维护';
} else {
$v['develop_type'] = '未设定';
}
$v['inside_cash_count'] = number_format($v['inside_cash_count'],2,'.','');
$v['allcount'] = number_format($v['cash_count']-0+$v['balance_coin_count']+$v['bind_coin_count'],2,'.','');
@ -148,6 +163,7 @@ class FinancePromoteController extends AdminController
"allcount"=>"渠道游戏内充值合计"
));
}
$pagecount = count($data);
$page = set_pagination($pagecount, $row);
if ($page) {
@ -222,7 +238,7 @@ class FinancePromoteController extends AdminController
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 bind_coin_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_id,0) company_id,company_name,IFNULL(promote.company_belong,0) company_belong";
IFNULL(company_id,0) company_id,company_name,IFNULL(promote.company_belong,0) company_belong,admin_id,develop_type";
return M()
->table("tab_spend s use index(promote_time)")
->field($field)
@ -239,7 +255,7 @@ class FinancePromoteController extends AdminController
$map['s.source_id']=0;
$field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='',
s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id,
IFNULL(company_id,0) company_id,company_name,IFNULL(promote.company_belong,0) company_belong";
IFNULL(company_id,0) company_id,company_name,IFNULL(promote.company_belong,0) company_belong,admin_id,develop_type";
return M("promote_coin s","tab_")
->field($field)
->where($map)
@ -323,7 +339,7 @@ class FinancePromoteController extends AdminController
$v['company_belong'] = getCompanyBlong($v['company_belong']);
if(empty($v['company_name'])) $v['company_name']= $this->COMPANY_NAME;
if(empty($v['promote_account'])) $v['promote_account']= "官方渠道";
if(empty($v['promote_account'])) $v['promote_account']= C('OFFICIEL_CHANNEL');
if(!array_key_exists('cash_count',$v)) $v['cash_count']=0;
if(!array_key_exists('balance_coin_count',$v)) $v['balance_coin_count']=0;
if(!array_key_exists('bind_coin_count',$v)) $v['bind_coin_count']=0;
@ -460,6 +476,7 @@ class FinancePromoteController extends AdminController
$value['inside_cash_count']?:0;
$value['all_cash_count'] = number_format($value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count'],2,'.','');
$value['company_belong'] =getCompanyBlong($value['company_belong']);
($value['account']=='官方渠道')?($value['account']=C('OFFICIEL_CHANNEL')):'';
$value['game_name'] =clearGameNameType($value['game_name']);
$value['sdk_version'] =getGameTypeName($value['sdk_version']);
@ -589,6 +606,7 @@ class FinancePromoteController extends AdminController
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
if (isset($_REQUEST['export'])) {
checkEncryptionAuth($data[$key]['user_account'],'gameStatisticsDetail');

@ -510,7 +510,7 @@ class GameController extends ThinkController
foreach($sociatyGames as $key => $value) {
$sociatyGamesData[$key]['id'] = $value['id'];
if($value['promote_id'] == -1) {
$sociatyGamesData[$key]['promoteAccount'] = "官方渠道";
$sociatyGamesData[$key]['promoteAccount'] = C('OFFICIEL_CHANNEL');
}else {
$promoteAccount = M('promote','tab_')->where(['id'=>$value['promote_id']])->getField('account');
$sociatyGamesData[$key]['promoteAccount'] = $promoteAccount;
@ -1229,7 +1229,7 @@ class GameController extends ThinkController
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$data_president = M('AuthGroup')->field('data_president')->where(array('id'=>1))->find();
$promoteData = array_merge([0=>['value'=>'-1','title'=>'官方渠道']],$promoteData);
$promoteData = array_merge([0=>['value'=>'-1','title'=>C('OFFICIEL_CHANNEL')]],$promoteData);
$returnData = array('data_president'=>$data_president['data_president'],'list'=>$promoteData);
$this->ajaxReturn(json_encode($returnData));

@ -160,6 +160,11 @@ class MemberController extends ThinkController
}
$data = $data->select();
foreach ($data as $key=>$value ) {
($data[$key]['promote_account']=='官方渠道'||$data[$key]['promote_account']=='自然注册')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
// dump($data);die();
if(isset($_REQUEST['export'])){
$isadmin = is_administrator();
//获取等级
@ -173,6 +178,7 @@ class MemberController extends ThinkController
foreach ($data as $k => &$v) {
$v['register_type'] = get_registertype($v['register_type']);
if(!$isadmin){
$v['account'] = encryptStr($v['account']);
$v['promote_account'] = encryptStr($v['promote_account']);
@ -217,7 +223,9 @@ class MemberController extends ThinkController
));
data2csv($data,"玩家_玩家列表",$field);
}
// foreach ($data as $key=>&$value ) {
// ($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
// }
//计算总人数
if($is_repeat){
$field ="count(*) user_count,IFNULL(sum(ss.pay_amount), 0) recharge_total";

@ -80,6 +80,9 @@ class MendController extends ThinkController {
}
//格式化信息
foreach ($data as $key => $value) {
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
$data[$key]['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
$data[$key]['order_time'] = date("Y-m-d H:i:s",$value['order_time']);
if(!$show_data_power){

@ -663,6 +663,7 @@ class PayChannelController extends ThinkController
foreach ($data as $key => $value) {
$data[$key]['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
if ($model == 'spend') {
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);

@ -521,7 +521,7 @@ class PlatformController extends ThinkController
$data = [];
foreach($tmdata as $k => $v){
if($v['id'] == 0){
$v['promote_account'] = "官方渠道";
$v['promote_account'] = C('OFFICIEL_CHANNEL');
}
$data[] = $v;
}

@ -318,7 +318,7 @@ class PromoteCompanyController extends ThinkController
$save['last_up_time'] = $time;
$save['contact_begin']=strtotime($save['contact_begin']);
$save['contact_end']=strtotime($save['contact_end']);
if(isset($save['resources'])){
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
}

@ -1561,25 +1561,32 @@ class QueryController extends ThinkController
if ($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
if ($_REQUEST['promote_id']=='0') {
unset($map['root_id']);
$map['promote_account'] = '官方渠道';
$whereMarket['promote_account'] = '官方渠道';
$map['promote_account'] = C('OFFICIEL_CHANNEL');
} else {
$map['root_id'] = $_REQUEST['promote_id'];
$whereMarket['root_id'] = $_REQUEST['promote_id'];
}
}
if ($_REQUEST['game_name']) {
$map['game_names'] = $_REQUEST['game_name'];
$whereMarket['game_names'] = $_REQUEST['game_name'];
}
if ($_REQUEST['count_date']) {
$map['my_time'] = $_REQUEST['count_date'];
$whereMarket['my_time'] = $_REQUEST['count_date'];
}
if ($_REQUEST['device']) {
// $map['tab_spend.sdk_version'] = $_REQUEST['device'];
$spendMap['tab_spend.sdk_version'] = $_REQUEST['device'];
$whereMarket['sdk_version'] = $_REQUEST['device'];
}
$spendMap['pay_time'] = ['between',[strtotime(date('Ymd',time())),strtotime(date('Ymd',time()))+86399]];
$spendMap['tab_spend.pay_status'] = 1;
//获取spend表中的数据同时根据会长id进行group分类
$data = M('Spend','tab_')
@ -1592,13 +1599,13 @@ class QueryController extends ThinkController
->select(false);
$count = M()->table('('.$data.') as a')
->field("my_time,pay_amount,game_id,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account")
->join("left join tab_promote on root_id = tab_promote.id")
->group("my_time,game_names,root_id")
->where($map)
->order("my_time Desc")
->select(false);
// $count = M()->table('('.$data.') as a')
// ->field("my_time,pay_amount,game_id,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account")
// ->join("left join tab_promote on root_id = tab_promote.id")
// ->group("my_time,game_names,root_id")
// ->where($map)
// ->order("my_time Desc")
// ->select(false);
//关联表获取会长账号名
$data = M()->table('('.$data.') as a')
@ -1606,34 +1613,34 @@ class QueryController extends ThinkController
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id and tab_ratio.status=1")
// ->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id")
->page($page,$row)
// ->page($page,$row)
->where($map)
->group("my_time,game_names,root_id")
->order("my_time Desc")
->select();
// var_dump($data);die();
// dump($data);die();
$pagecount = M()->table('('.$count.') as a')->count();
// $pagecount = M()->table('('.$count.') as a')->count();
foreach($data as $key => $value) {
$mytime = $value['my_time'];
$nextMonth = date('Y-m',strtotime("$mytime + 1 month"));
$game_id = $value['game_id'];
$gameInfo = M('game','tab_')->where(['id'=>$game_id])->getField('game_name');
$gameName = substr($gameInfo,0,strpos($gameInfo,'('));
$gameMap['game_name'] = ['like','%'.$gameName.'%'];
$gameIdArr = M('game','tab_')->field('id')->where($gameMap)->select();
$gameNameIdArr = [];
foreach($gameIdArr as $gameKey => $gameValue){
$gameNameIdArr[] = $gameValue['id'];
}
$promote_id = $value['promote_id'];
$pay_status = 1;
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level'];
if($promote_id != 0) {
$mytime = $value['my_time'];
$nextMonth = date('Y-m',strtotime("$mytime + 1 month"));
$game_id = $value['game_id'];
$gameInfo = M('game','tab_')->where(['id'=>$game_id])->getField('game_name');
$gameName = substr($gameInfo,0,strpos($gameInfo,'('));
$gameMap['game_name'] = ['like','%'.$gameName.'%'];
$gameIdArr = M('game','tab_')->field('id')->where($gameMap)->select();
($data[$key]['account']=='官方渠道')?($data[$key]['account']=C('OFFICIEL_CHANNEL')):'';
$gameNameIdArr = [];
foreach($gameIdArr as $gameKey => $gameValue){
$gameNameIdArr[] = $gameValue['id'];
}
$promote_id = $value['promote_id'];
$pay_status = 1;
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level'];
if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) {
$rootPromoteId = $promote_id;
@ -1643,33 +1650,38 @@ class QueryController extends ThinkController
$chainArr = explode('/',$chain);
$rootPromoteId = $chainArr[1];
}
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
$promoteIdArr[] = $v1['id'];
}
$where['promote_id'] = ['in',$promoteIdArr];
}else {
}else {
$where['promote_id'] = 0;
}
$where['game_id'] = ['in',$gameNameIdArr];
$where['pay_status'] = 1;
$begTime = strtotime($mytime);
$endTime = strtotime($nextMonth);
$where['pay_time'] = ['between',[$begTime,$endTime]];
$spendInfo = M('spend','tab_')->field('pay_amount,pay_way')->where($where)->select();
$initNum = 0;
foreach($spendInfo as $key1 => $spendValue) {
$pay_way = $spendValue['pay_way'];
$channel_rate = $this->getChannelConfig($pay_way) / 100;
$initNum += $spendValue['pay_amount'] * $channel_rate;
}
$data[$key]['pay_amount'] = $value['pay_amount'] - $initNum;
}
$where['game_id'] = ['in',$gameNameIdArr];
$where['pay_status'] = 1;
$where['sdk_version'] = $value['sdk_version'];
$begTime = strtotime($mytime);
$endTime = strtotime($nextMonth);
$where['pay_time'] = ['between',[strtotime(date('Ymd',time())),strtotime(date('Ymd',time()))+86399]];
$spendInfo = M('spend','tab_')->field('pay_amount,pay_way')->where($where)->select();
$initNum = 0;
foreach($spendInfo as $key1 => $spendValue) {
$pay_way = $spendValue['pay_way'];
$channel_rate = $this->getChannelConfig($pay_way) / 100;
$initNum += $spendValue['pay_amount'] * $channel_rate;
}
$data[$key]['pay_amount'] = $value['pay_amount'] - $initNum;
// if ($value['games_ratio']) {
// $data[$key]['upstream'] = $value['pay_amount'] * ($value['games_ratio']*0.01);
// } else {
$data[$key]['upstream'] = caculateUpstream($value['game_id'],$value['pay_amount']);
$data[$key]['upstream'] = caculateUpstream($value['game_id'],$value['pay_amount']);
// }
if ($value['ratio']) {
@ -1702,7 +1714,58 @@ class QueryController extends ThinkController
}
$page = set_pagination($pagecount, $row);
// dump($data);die();
// $whereMarket['my_time'] = date('Y-m',time());
$marketData = M('market_balance','tab_')
->field("*,sum(pay_amount) pay_amount,sum(upstream) upstream,sum(downstream) downstream,sum(highquality) highquality")
->where($whereMarket)
->group('my_time,game_names,root_id')
->order('id ASC')
->select();
// dump($marketData);die();
$data = array_merge($marketData,$data);
// dump($data);
//die();
$new_data = [];
foreach($data as $key => $value) {
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['pay_amount'] += $value['pay_amount'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['upstream'] += $value['upstream'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['downstream'] += $value['downstream'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['highquality'] += $value['highquality'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['id'] = $value['id'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['my_time'] = $value['my_time'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['game_id'] = $value['game_id'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['game_name'] = $value['game_name'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['game_names'] = $value['game_names'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['promote_id'] = $value['promote_id'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['promote_account'] = $value['promote_account'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['company_relation'] = $value['company_relation'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['company_belong'] = $value['company_belong'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['root_id'] = $value['root_id'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['account'] = $value['account'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['ratio'] = $value['ratio'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['turnover_ratio'] = $value['turnover_ratio'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['game_ratio'] = $value['game_ratio'];
$new_data[$value['my_time'].$value['game_names'].$value['promote_id'].$value['root_id']]['sdk_version'] = $value['sdk_version'];
}
// die();
$data = array_values($new_data);
$count = count($data);
$page = set_pagination($count, $row);
$size = $row;//每页显示的记录数
$data = array_slice($data, ($arraypage - 1) * $size, $size);
if ($page) {
$this->assign('_page', $page);
}

@ -90,10 +90,10 @@ class RechargeSumController extends ThinkController
$data[$key]['game_id'] = empty($_REQUEST['game_name']) ? "全部" : $_REQUEST['game_name'];
switch ($_REQUEST['promote_id']) {
case 'GUANFANG':
$data[$key]['promote_id'] = "官方渠道";
$data[$key]['promote_id'] = C('OFFICIEL_CHANNEL');
break;
case '0':
$data[$key]['promote_id'] = "官方渠道";
$data[$key]['promote_id'] = C('OFFICIEL_CHANNEL');
break;
case 'PROMOTE':
$data[$key]['promote_id'] = "推广渠道";

@ -125,6 +125,10 @@ class SpendController extends ThinkController
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
foreach ($data['data'] as $key=>&$value ) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$this->assign('startDate', $startDate);
$this->assign('endDate', $endDate);
$this->assign('list_data', $data['data']);

@ -186,7 +186,7 @@ class StatisticsCountSetController extends Controller {
$value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list'])));
if(empty($value['promote_account']) && $value['promote_id']){
if($value['promote_id'] == 0){
$value['promote_account'] = "官方渠道";
$value['promote_account'] = C('OFFICIEL_CHANNEL');
}else{
$value['promote_account'] = $this->PromoteModel->field("account")->where("id = {$value['promote_id']}")->find()['account'];
if(!$value['promote_account']){

@ -110,6 +110,8 @@ class TestResourceController extends ThinkController
foreach ($data as $key => $value) {
$data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$count = M('test_resource','tab_')
@ -371,6 +373,10 @@ class TestResourceController extends ThinkController
}
M('protect_log_read', 'tab_')->commit(); //提交事物
foreach($data as $key => $value) {
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$count = count($count);
$page = set_pagination($count,$row);
$this->meta_title = '日志管理';
@ -427,6 +433,9 @@ class TestResourceController extends ThinkController
}
//
$res = D("test_resource")->getResourceCout($map,$page,$row);
foreach ($res['list'] as $key=>&$value) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
// dump($res);
$parameter =I('get.');
$parameter['p']=I('get.p',1);
@ -831,6 +840,10 @@ class TestResourceController extends ThinkController
$parameter['p']=I('get.p',1);
$parameter['row']=I('get.row');
foreach ($data as $key=>&$value) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$page = set_pagination($count,$row,$parameter);
if($page) {$this->assign('_page', $page);}

@ -343,4 +343,194 @@ class TimingController extends AdminController {
}
public function caculateMarketList() {
$map = [];
$map['my_time'] = date('Y-m',strtotime('-1 month'));
if ($_REQUEST['count_date']) {
$map['my_time'] = $_REQUEST['count_date'];
}
if ($_REQUEST['count_date'] == 'all') {
$map['my_time'] = ['neq', date('Y-m',time())];
}
$spendMap['tab_spend.pay_status'] = 1;
//获取spend表中的数据同时根据会长id进行group分类
$data = M('Spend','tab_')
->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,tab_spend.game_name,SUBSTRING_INDEX(tab_spend.`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,tab_game.ratio,tab_game.relation_game_id,tab_spend.sdk_version ")
->join("left join tab_promote on promote_id = tab_promote.id")
->join("left join tab_game on tab_game.id=tab_spend.game_id")
->where($spendMap)
->group("my_time,game_id,root_id")
->order("my_time Desc")
->select(false);
//关联表获取会长账号名
$data = M()->table('('.$data.') as a')
->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio,a.ratio as game_ratio,a.sdk_version")
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id and tab_ratio.status=1")
->where($map)
->group("my_time,game_id,root_id")
->order("my_time Desc")
->select();
// dump($data);die();
foreach($data as $key => $value) {
echo "{$value['my_time']}-{$value['promote_account']}-{$value['game_name']}:{$value['pay_amount']}\n";
$mytime = $value['my_time'];
$nextMonth = date('Y-m',strtotime("$mytime + 1 month"));
$game_id = $value['game_id'];
$gameInfo = M('game','tab_')->where(['id'=>$game_id])->getField('game_name');
$gameName = substr($gameInfo,0,strpos($gameInfo,'('));
$gameMap['game_name'] = ['like','%'.$gameName.'%'];
$gameIdArr = M('game','tab_')->field('id')->where($gameMap)->select();
$gameNameIdArr = [];
foreach($gameIdArr as $gameKey => $gameValue){
$gameNameIdArr[] = $gameValue['id'];
}
$promote_id = $value['promote_id'];
$pay_status = 1;
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level'];
if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) {
$rootPromoteId = $promote_id;
$promoteIdArr[] = $promote_id;
}else {
$chain = $promoteInfo['chain'];
$chainArr = explode('/',$chain);
$rootPromoteId = $chainArr[1];
}
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
}
$where['promote_id'] = ['in',$promoteIdArr];
if (!$promoteIdArr) {
$where['promote_id']= 0;
}
}else {
$where['promote_id'] = 0;
}
$where['game_id'] = ['in',$gameNameIdArr];
$where['pay_status'] = 1;
$begTime = strtotime($mytime);
$endTime = strtotime($nextMonth);
$where['pay_time'] = ['between',[$begTime,$endTime]];
$spendInfo = M('spend','tab_')->field('pay_amount,pay_way')->where($where)->select();
$initNum = 0;
foreach($spendInfo as $key1 => $spendValue) {
$pay_way = $spendValue['pay_way'];
$channel_rate = $this->getChannelConfig($pay_way) / 100;
$initNum += $spendValue['pay_amount'] * $channel_rate;
}
$data[$key]['pay_amount'] = $value['pay_amount'] - $initNum;
$data[$key]['upstream'] = caculateUpstream($value['game_id'],$value['pay_amount']);
if ($value['ratio']) {
$data[$key]['downstream'] = $value['pay_amount'] * ($value['ratio']*0.01);
} else {
$data[$key]['downstream'] = $value['pay_amount'] * ($value['game_ratio']*0.01);
}
$value['turnover_ratio'] = json_decode($value['turnover_ratio'],true);
// dd($value);
if (is_array($value['turnover_ratio'])) {
foreach($value['turnover_ratio'] as $k =>$v) {
if(($value['pay_amount']>=$v['turnover']&&$v['instanceof']==1) || $value['pay_amount']>$v['turnover']) {
$data[$key]['downstream'] = $value['pay_amount'] * ($v['ratio']*0.01);
}
}
}
$data[$key]['highquality'] = number_format(($value['pay_amount'] - $initNum - $data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672),2,'.','');
if (!$data[$key]['company_belong']) {
$data[$key]['company_belong'] = getCompanyBlong(0);
} else {
$data[$key]['company_belong'] = getCompanyBlong($data[$key]['company_belong']);
}
$data[$key]['company_relation'] = $data[$key]['company_relation']?'只维护':'自主开发及维护';
}
foreach($data as $key => $value) {
$is_hav = M('market_balance','tab_')->where(['my_time'=>$value['my_time'],
'game_id'=>$value['game_id'],
'promote_id'=>$value['promote_id'],
'root_id'=>$value['root_id']])->find();
if (!$is_hav) {
M('market_balance','tab_')->add($value);
} else {
M('market_balance','tab_')
->where(['my_time'=>$value['my_time'],
'game_id'=>$value['game_id'],
'promote_id'=>$value['promote_id'],
'root_id'=>$value['root_id']])
->save(['pay_amount'=>$value['pay_amount'],
'ratio'=>$value['ratio'],
'turnover_ratio'=>$value['turnover_ratio'],
'game_ratio'=>$value['game_ratio'],
'upstream'=>$value['upstream'],
'downstream'=>$value['downstream'],
'highquality'=>$value['highquality']]);
}
}
echo 'success';
// dump($data);die();
}
public function getChannelConfig($pay_way = 0,$config=false) {
if(!$config) {
$payWayName = $this->pay_way_name[$pay_way];
$toolConfig = M('tool','tab_')->where(['name'=>$payWayName])->find();
$config = json_decode($toolConfig['config'],true);
if(empty($config['channel_rate'])){
$channel_rate = 0;
}else {
$channel_rate = $config['channel_rate'];
}
}else {
foreach($this->pay_way_name as $key => $value) {
$name = $value;
$toolConfig = M('tool','tab_')->where(['name'=>$name])->find();
$config = json_decode($toolConfig['config'],true);
if(empty($config['channel_rate'])){
$channel_rate[$key] = 0;
}else {
$channel_rate[$key] = $config['channel_rate'];
}
}
}
return $channel_rate;
}
}

@ -704,6 +704,11 @@ class UserController extends AdminController
empty(I('user_account')) || $map['user_account'] = ['like', "%" . I('user_account') . "%"];
$this->checkListOrCountAuthRestMap($map,["role_id", "role_name", "user_account"]);
$list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc');
foreach ($list as $key=>&$value ) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
}
$this->assign('list', $list);
$this->meta_title = '角色数据';

@ -404,7 +404,7 @@ class PromoteModel extends Model{
$userAuth = session('user_auth');
setPowerPromoteIds($where,'id');
$offcialData = [0=>['id'=>0,'nickname'=>'官方渠道']];
$offcialData = [0=>['id'=>0,'nickname'=>C('OFFICIEL_CHANNEL')]];
$result = $this->field("*")->where($where)->select();
foreach ($result as &$item) {

@ -60,7 +60,7 @@
<label>推广员账号:</label>
<select id="promote_id" name="promote_id" class="select_gallery" style="width:150px;">
<option value="">请选择推广员账号</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<volist name=":get_promote_list(1)" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>

@ -160,16 +160,26 @@
<td>
<if condition="$data['promote_account'] eq '自然注册'">
<if condition="$show_data_power eq true ">
官方渠道
{:C('OFFICIEL_CHANNEL')}
<else />
官*******道
</if>
<else/>
<if condition="$show_data_power eq true ">
{$data.promote_account}
<if condition="$data.promote_account eq '官方渠道' ">
{:C('OFFICIEL_CHANNEL')}
<else/>
{$data.promote_account}
</if>
<else />
{$data.promote_account|encryptStr}
<if condition="$data.promote_account eq '官方渠道' ">
{:C('OFFICIEL_CHANNEL')}
<else/>
{$data.promote_account|encryptStr}
</if>
</if>
</if>
</td>

@ -107,7 +107,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>

@ -91,7 +91,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
</select>
</div>
@ -361,7 +361,7 @@
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>';
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>{:C(\'OFFICIEL_CHANNEL\')}</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>';

@ -165,7 +165,9 @@
<tr>
<th>推广公司</th>
<th>会长渠道</th>
<th>开发类型</th>
<th>内外团</th>
<th>市场专员</th>
<th class="tooltip"><a class="paixu" data-order='cash_count'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'cash_count'">游戏现金金额▲
@ -215,7 +217,9 @@
<tr>
<td>{$data.company_name}</td>
<td>{$data['promote_account']}</td>
<td>{$data['develop_type']}</td>
<td>{$data['company_belong']}</td>
<td>{$data['admin_id']}</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_type'=>1,'promote_id'=>$data['p_id'],p=>1,row=>10]))}">
@ -248,7 +252,7 @@
</volist>
</empty>
<tr class="data_summary" style="text-align: center;">
<td colspan="3" style="text-align: center;">汇总:</td>
<td colspan="5" style="text-align: center;">汇总:</td>
<td style="text-align: center;">{$all_count['cash_count']}</td>
<td style="text-align: center;">{$all_count['balance_coin_count']}</td>
<td style="text-align: center;">{$all_count['bind_coin_count']}</td>

@ -105,7 +105,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>

@ -376,7 +376,7 @@
success: function (response) {
str = '<option value="">请选择会长</option>';
if(company_id == 0 || company_id ==-1){
str +='<option value="0"' + (promote_id && 0 == promote_id ? 'selected' : '') + '>官方渠道</option>';
str +='<option value="0"' + (promote_id && 0 == promote_id ? 'selected' : '') + '>{:C(\'OFFICIEL_CHANNEL\')}</option>';
}
data = response.data;
for (var i in data) {

@ -156,7 +156,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
@ -272,7 +272,7 @@
</if>
<td >
<if condition="$data['promote_account'] eq '自然注册'">
官方渠道
{:C('OFFICIEL_CHANNEL')}
<else/>
<empty name='data["promote_account"]'>---<else/>
<if condition="$show_data_power eq true ">

@ -74,7 +74,7 @@
<td class="r table_radio">
<select id="prmoote_id_to" name="prmoote_id_to" class="select_gallery">
<option value="">下拉选择</option>
<option value="-1">官方渠道</option>
<option value="-1">{:C('OFFICIEL_CHANNEL')}</option>
<volist name=":get_promote_list()" id="vo">
<option value="{$vo.id}">{$vo.account}{:get_parent_promoteto($vo['id'])}</option>
</volist>

@ -176,6 +176,17 @@
</td>
</tr>
<tr>
<td class="l">开发类型:</td>
<td class="r" >
<select id="develop_type" name="develop_type" class="select_gallery" style="width: 215px;">
<option value="">请选择开发类型</option>
<option value="1" >自主开发</option>
<option value="2" >自主开发及维护</option>
<option value="3" >只维护</option>
</select>
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r" >
@ -316,7 +327,8 @@
"ali_user":["nocheck","支付宝真实姓名不能为空"],
"ali_account":["nocheck","支付宝登陆账号不能为空"],
"content":["nocheck"],
"status":["nocheck","","radio"]
"status":["nocheck","","radio"],
"develop_type":["nocheck","开发类型不能为空","select"]
}
var cres = CIC.checkAddInput(obj);
if(!cres){

@ -180,6 +180,17 @@
</td>
</tr>
<tr>
<td class="l">开发类型:</td>
<td class="r" >
<select id="develop_type" name="develop_type" class="select_gallery" style="width: 215px;">
<option value="">请选择开发类型</option>
<option value="1" <if condition="$data.develop_type eq 1">selected</if>>自主开发</option>
<option value="2" <if condition="$data.develop_type eq 2">selected</if>>自主开发及维护</option>
<option value="3" <if condition="$data.develop_type eq 3">selected</if>>只维护</option>
</select>
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r" >
@ -385,7 +396,8 @@
"ali_user":[["nocheck",true],"支付宝真实姓名不能为空"],
"ali_account":[["nocheck",true],"支付宝登陆账号不能为空"],
"content":[["nocheck",true]],
"status":["nocheck","","radio"]
"status":["nocheck","","radio"],
"develop_type":["nocheck","开发类型不能为空","select"]
}
var cres = CIC.checkAddInput(obj);
if(!cres){

@ -178,6 +178,17 @@
</td>
</tr>
<tr>
<td class="l">开发类型:</td>
<td class="r" >
<select id="develop_type" name="develop_type" class="select_gallery" disabled="true" style="width: 215px;">
<option value="">请选择开发类型</option>
<option value="1" <if condition="$data.develop_type eq 1">selected</if>>自主开发</option>
<option value="2" <if condition="$data.develop_type eq 2">selected</if>>自主开发及维护</option>
<option value="3" <if condition="$data.develop_type eq 3">selected</if>>只维护</option>
</select>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px"></i>备注:</td>
<td class="r" >

@ -82,7 +82,7 @@
<td class="r">
<select id="promote_id" name="promote_id" class="select_2">
<option value="-1">全站玩家</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<option value="-2">推广渠道</option>
</select>
</td>

@ -70,7 +70,7 @@
<td class="r">
<select id="promote_id_obj" name="promote_id" disabled="disabled">
<option value="-1">全站玩家</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<option value="-2">推广渠道</option>
</select>
</td>

@ -78,7 +78,7 @@
<select name="promote_id" class="select_gallery" style="width:120px;">
<option value="">折扣对象</option>
<option value="-1">全站玩家</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<option value="-2">推广渠道</option>
</select>
</div>

@ -74,7 +74,7 @@
<td class="r">
<select name="promote_id">
<option value="-1">全站玩家</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<option value="1">推广渠道</option>
</select>
<span class="notice-text">设置不同对象可享受的返利,对象包含全站玩家、官方渠道、推广渠道</span>

@ -49,7 +49,7 @@
<td class="r">
<select name="promote_id" disabled="disabled">
<option value="-1">全站玩家</option>
<option value="0">官方渠道</option>
<option value="0">{:C('OFFICIEL_CHANNEL')}</option>
<option value="1">推广渠道</option>
</select>
<span class="notice-text">设置不同对象可享受的返利,对象包含全站玩家、官方渠道、推广渠道</span>

@ -114,7 +114,7 @@
<td>
<switch name="data.promote_id">
<case value="-1">全站玩家</case>
<case value="0">官方渠道</case>
<case value="0">{:C('OFFICIEL_CHANNEL')}</case>
<case value="1">推广渠道</case>
</switch>
</td>

@ -205,7 +205,7 @@
<gt name="data.small_id" value="0"><neq name="data.small_id" value="$data.user_id">{$data.small_account}</neq></gt></td>
<td>{$data.game_name}</td>
<td>
<eq name="data.promote_id" value="-1">官方渠道<else/>
<eq name="data.promote_id" value="-1">C('OFFICIEL_CHANNEL')<else/>
<!-- <if condition="$is_admin eq true ">
{:get_promote_account($data['promote_id'])}
<else />

@ -125,7 +125,7 @@
<td>{$data.game_name}</td>
<td>
<if condition="$data.promote_account == '自然注册'">
官方渠道
{:C('OFFICIEL_CHANNEL')}
<else />
{$data.promote_account}
</if>
@ -391,7 +391,7 @@
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>';
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>{:C(\'OFFICIEL_CHANNEL\')}</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>"

@ -393,7 +393,7 @@
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>';
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>{:C(\'OFFICIEL_CHANNEL\')}</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>"

@ -196,7 +196,7 @@
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>';
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>{:C(\'OFFICIEL_CHANNEL\')}</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>';

@ -75,7 +75,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>
@ -238,7 +238,7 @@
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>';
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>{:C("OFFICIEL_CHANNEL")}</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>';

@ -116,7 +116,7 @@
<td>
<switch name="data.promote_id">
<case value="-1">全站玩家</case>
<case value="0">官方渠道</case>
<case value="0">{:C('OFFICIEL_CHANNEL')}</case>
<case value="1">推广渠道</case>
</switch>
</td>

@ -96,7 +96,7 @@
<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="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>{:C('OFFICIEL_CHANNEL')}</option>
<option value="UC" <?php if ($_POST['promote_id'] == 'UC'):?>selected<?php endif;?>>UC用户</option>
</select>
</div>

@ -321,8 +321,8 @@ class PromoteService {
$toPromote = M('promote', 'tab_')->where(['id' => $toPromoteId])->find();
$fromPromote = M('promote', 'tab_')->where(['id' => $fromPromoteId])->find();
$toPromote = $toPromote ?? ['id' => 0, 'account' => '官方渠道'];
$fromPromote = $fromPromote ?? ['id' => 0, 'account' => '官方渠道'];
$toPromote = $toPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL')];
$fromPromote = $fromPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL')];
if ($fromPromote['id'] == 0 && count($shiftIds) == 0) {
@ -953,7 +953,7 @@ class PromoteService {
'bank_name' => $params['bank_name'] ?? '',
'bank_card' => $params['bank_card'],
'parent_id' => $parent ? $parent['id'] : 0,
'parent_name' => $parent ? $parent['account'] : '官方渠道',
'parent_name' => $parent ? $parent['account'] : C('OFFICIEL_CHANNEL'),
'admin_id' => $params['admin_id'] ?? 0,
'company_id' => $params['company_id'] ?? 0,
'invite_code' => $params['invite_code'] ?? '',

@ -1222,12 +1222,12 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null)
*/
function get_promote_name($prmote_id=0){
if($prmote_id==0){
return "官方渠道";
return C('OFFICIEL_CHANNEL');
}
$promote = M("promote","tab_");
$map['id'] = $prmote_id;
$data = $promote->where($map)->find();
if(empty($data)){return "官方渠道";}
if(empty($data)){return C('OFFICIEL_CHANNEL');}
if(empty($data['account'])){return "未知推广";}
$result = $data['account'];
return $result;

@ -1870,7 +1870,7 @@ CREATE TABLE `tab_company_statement` (
`statement_money` decimal(10,2) DEFAULT '0.00' COMMENT '对账金额',
`pay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '总计',
`platform_amount` decimal(10,2) DEFAULT '0.00' COMMENT '平台流水金额',
`verify_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '审核状态 -2:汇总驳回 -1审批拒绝 0:系统生成 1:审核通过 2:对外发起 3:合作确认 4:汇总',
`verify_log` text NOT NULL COMMENT '审批相关信息json',
`pay_type` tinyint(2) DEFAULT '0' COMMENT '1甲方收款;2乙方收款',
@ -1989,6 +1989,15 @@ INSERT INTO `tab_tool`( `name`, `title`, `config`, `template`, `type`, `status`,
INSERT INTO `tab_tool`( `name`, `title`, `config`, `template`, `type`, `status`, `create_time`) VALUES ('juhe_age', '聚合身份认证', '{\"appkey\":\"80427f4769c6938f12a870f51014ddbe\",\"status\":\"1\"}', NULL, 1, 1, 1464164373);
ALTER TABLE `tab_forbit_ip`
ADD COLUMN `type` tinyint(2) NULL DEFAULT 0 COMMENT '类型 0美国ip白名单 1苹果第三方支付白名单 2 测试白名单' AFTER `remarks`;
ALTER TABLE `tab_forbit_ip`
ADD UNIQUE INDEX `userid_type`(`user_id`, `type`) COMMENT '用户id与类型唯一索引';
ALTER TABLE `tab_promote_company`
ADD COLUMN `develop_type` tinyint(2) NULL DEFAULT 0 COMMENT '1 自主开发 2 自主开发及维护 3 只维护' AFTER `company_belong`;
ALTER TABLE `tab_forbit_ip`
ADD COLUMN `type` tinyint(2) NULL DEFAULT 0 COMMENT '类型 0美国ip白名单 1苹果第三方支付白名单' AFTER `remarks`;

Loading…
Cancel
Save