推广列表查看

master
chenzhi 5 years ago
parent 38fc3c3054
commit da2e3a769c

@ -39,10 +39,15 @@ class PromoteCompanyController extends ThinkController
$companyres = $model->field("*")
->where($map)
->order("last_up_time desc")
// ->page($page,$row)
->page($page,$row)
->select();
//获取公司id
$companyids = implode(',', array_column($companyres, 'id'));
// //处理公司数据
// $company = array();
// foreach($companyres as $k=>$v){
// $company[]
// }
//获取所属会长及其游戏分成
$promoteres = M("Promote","tab_")
->field("id,company_id,account,settlement_type")
@ -70,6 +75,7 @@ class PromoteCompanyController extends ThinkController
$v['turnover_ratio'] = array(
array("ratio"=>$v['ratio'],"name"=>"默认比例")
);
foreach($turnover_ratio as $ke=>$va){
$t=array("ratio"=>$va["ratio"]);
if(array_key_exists("instanceof",$va)){
@ -84,24 +90,94 @@ class PromoteCompanyController extends ThinkController
}
$v['turnover_ratio'][]=$t;
}
$v['row'] = count($v['turnover_ratio']);
unset($v["ratio"]);
unset($v["relation_game_id"]);
unset($v["game_id"]);
$gameradiotemp[$v['promote_id']]["list"][]=$v;
$gameradiotemp[$v['promote_id']][]=$v;
}
dd($gameradiotemp);
unset($gameradiores);
//会长数据处理
$promoterestemp=[];
foreach($promoteres as $k=>$v){
if(array_key_exists($v['id'],$gameradiotemp)){
//存在
$v['list'] = $gameradiotemp[$v['id']];
foreach($gameradiotemp[$v['id']] as $ke=>$va){
$v['row'] += $va['row'];
}
}else{
$v['list']=[
["relation_game_name"=>"--","game_type_name"=>"--",
"turnover_ratio"=>[
["name"=>"--","ratio"=>"--"]
],
"row"=>1
]
];
$v["row"]=1;
}
if($v['settlement_type'] == 1){
$v['settlement_type']="周结";
}else{
$v['settlement_type']="月结";
}
$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'];
}
}
}else{
//空值
$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{
$v["contact_begin"] = "--";
}
if( $v["contact_end"] > 0){
$v["contact_end"] = date('Y/m/d', $v["contact_end"]);
}else{
$v["contact_end"] = "--";
}
if($v['platform_name'] == '' || $v['platform_name'] == "0"){
$v['platform_name'] = "--";
}
$v["is_sign_contact"] = ($v["is_sign_contact"]=="1" ? "是" :'否');
}
// dd($companyres);
/* 查询记录总数 */
$count = $model
->where($map)
->count();
if (!empty($data)) {
foreach ($data as &$list) {
$list['status'] = ($list['status'] == 0) ? '已关闭' : '已开启';
$list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
}
}
//分页
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -110,7 +186,7 @@ class PromoteCompanyController extends ThinkController
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('listData', $companyres);
$this->assign('count', $count);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
$this->meta_title = '推广公司';

@ -58,18 +58,27 @@
<!-- 数据列表 -->
<div class="data_list data_game_list">
<div class="">
<table>
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>推广公司</th>
<th>显示状态</th>
<th>添加人</th>
<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 colspan="2">合作方分成比例</th>
</tr>
</thead>
@ -78,17 +87,99 @@
<empty name ="listData">
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data">
<volist name="listData" id="data" key="companykey">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.company_name}</td>
<td>{$data.status}</td>
<td>{$data.nickname}</td>
<td>{$data.create_time}</td>
<td>
<td rowspan="{$data.row}">
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
</td>
<td rowspan="{$data.row}">{$data.company_name}</td>
<td rowspan="{$data.row}">{$data.platform_name}</td>
<td rowspan="{$data.row}">{$data.contact_begin} - {$data.contact_end}</td>
<td rowspan="{$data.row}">{$data.fax_ratio}%</td>
<td rowspan="{$data.row}">{$data.bank_name}</td>
<td rowspan="{$data.row}">{$data.bank_card}</td>
<td rowspan="{$data.row}">{$data.is_sign_contact}</td>
<td rowspan="{$data.row}">{$data.content}</td>
<notempty name="data.list">
<foreach name="data['list']" item="promote" key="promotekey">
<if condition="$promotekey gt 0">
<tr>
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey eq 0">
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
<else />
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
</if>
</foreach>
</if>
</foreach>
</notempty>
</tr>
</volist>
</empty>

@ -1206,7 +1206,7 @@ ALTER TABLE `tab_promote_company`
--2020-02-11 chenzhi 广--
ALTER TABLE `tab_promote_company`
ADD COLUMN `platform_name` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '平台名称' AFTER `bank_address`,
ADD COLUMN `platform_name` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '平台名称' AFTER `bank_address`,
ADD COLUMN `contact_begin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同开始时间' AFTER `platform_name`,
ADD COLUMN `contact_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同结束时间' AFTER `contact_begin`,
ADD COLUMN `fax_ratio` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '开票税率' AFTER `contact_end`,

Loading…
Cancel
Save