隐藏推广公司分成比例

master
chenzhi 4 years ago
parent 21a738054a
commit f62cfca22b

@ -59,6 +59,7 @@ class PromoteCompanyController extends ThinkController
}else{
$companyres = $companyres->page($page,$row)->select();
}
if(1 == 0){
//获取公司id
$companyids = implode(',', array_column($companyres, 'id'));
//获取所属会长及其游戏分成
@ -72,17 +73,16 @@ class PromoteCompanyController extends ThinkController
//获取会长id
$promoteids = implode(',', array_column($promoteres, 'id'));
//获取游戏比例
// $gameradiores = M("PromoteGameRatio","tab_")
// ->alias("pg")
// ->field("pg.ratio,pg.relation_game_id,pg.turnover_ratio,pg.game_id,pg.promote_id,ga.relation_game_name,ga.game_type_name")
// ->join("tab_game ga ON pg.game_id = ga.id")
// ->where(array(
// "status"=>1,
// "promote_id"=>["in",$promoteids]
// ))
// ->group("relation_game_id,promote_id")
// ->select();
$gameradiores = [];
$gameradiores = M("PromoteGameRatio","tab_")
->alias("pg")
->field("pg.ratio,pg.relation_game_id,pg.turnover_ratio,pg.game_id,pg.promote_id,ga.relation_game_name,ga.game_type_name")
->join("tab_game ga ON pg.game_id = ga.id")
->where(array(
"status"=>1,
"promote_id"=>["in",$promoteids]
))
->group("relation_game_id,promote_id")
->select();
//比例数据处理
$gameradiotemp = array();
foreach($gameradiores as $k=>$v){
@ -140,39 +140,41 @@ class PromoteCompanyController extends ThinkController
$promoterestemp[$v['company_id']]["list"][]=$v;
}
unset($promoteres);
//处理公司数据
foreach($companyres as $k=>&$v){
if(array_key_exists($v['id'],$promoterestemp)){
//存在
$v['list'] = $promoterestemp[$v['id']]['list'];
foreach($promoterestemp[$v['id']] as $ke=>$va){
foreach($va as $key=>$val){
$v['row'] += $val['row'];
}
}
$v['can_del'] = 0;
}else{
//空值
$v['can_del'] = 1;
$v['list']=[
[
"account"=>"--",
"settlement_type"=>"--",
'list'=>[
[
"relation_game_name"=>"--",
"game_type_name"=>"--",
"turnover_ratio"=>[
["name"=>"--","ratio"=>"--"]
],
"row"=>1
]
]
]
];
$v['row'] += 1;
}
//处理公司数据
foreach($companyres as $k=>&$v){
// if(array_key_exists($v['id'],$promoterestemp)){
// //存在
// $v['list'] = $promoterestemp[$v['id']]['list'];
// foreach($promoterestemp[$v['id']] as $ke=>$va){
// foreach($va as $key=>$val){
// $v['row'] += $val['row'];
// }
// }
// $v['can_del'] = 0;
// }else{
// //空值
// $v['can_del'] = 1;
// $v['list']=[
// [
// "account"=>"--",
// "settlement_type"=>"--",
// 'list'=>[
// [
// "relation_game_name"=>"--",
// "game_type_name"=>"--",
// "turnover_ratio"=>[
// ["name"=>"--","ratio"=>"--"]
// ],
// "row"=>1
// ]
// ]
// ]
// ];
// $v['row'] += 1;
// }
if( $v["contact_begin"] >0 ){
$v["contact_begin"] = date('Y/m/d', $v["contact_begin"]);
}else{
@ -191,6 +193,7 @@ class PromoteCompanyController extends ThinkController
$v["company_type"] = ($v["company_type"]=="1" ? "公司" :'个人');
$v["company_belong"] = ($v["company_belong"]=="0" ? "内团" : ($v["company_belong"]=="1" ? "外团" : ($v["company_belong"]=="2" ? "外团分发" : '无')));
}
// dd($companyres);

@ -125,12 +125,12 @@
<th>银行账号</th>
<th>是否签署合同</th>
<th>备注</th>
<!--
<th>会长账号</th>
<th>结算周期</th>
<th>产品类型</th>
<th>游戏名称</th>
<th colspan="2">合作方分成比例</th>
<th colspan="2">合作方分成比例</th> -->
</tr>
</thead>

Loading…
Cancel
Save