新增0不查看

master
chenzhi 4 years ago
parent 547b512ead
commit 88c70c29db

@ -193,23 +193,45 @@ class CompanyStatementPoolController extends ThinkController
$line = 1;
$count = [];
//获取对接人
$p_id = array_column($infolist,'company_id');
$map['pc.id'] = ['in',$p_id];
$pl = M("promote_company","tab_")
->alias('pc')
->field("pc.id,p.account,p.company_relation,s.nickname,pc.bank_address,pc.bank_name,pc.bank_card,pc.company_belong")
->join("left join (select company_id,account,company_relation from tab_promote where level = 1 group by company_id ) p on p.company_id = pc.id")
->join("left join sys_member s on s.uid = pc.uid")
->where($map)
->select();
$Partner = [];
foreach($pl as $k=>$v){
$Partner[$v['id']] = $v;
}
unset($pl);
foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true);
$v['company_info'] = json_decode($v['company_info'],true);
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
$cline = $line+1;
if($is_export){
$v['sum_money_exp'] = "=";
}
foreach($v['statement_info'] as $ke=>&$va){
$line ++;
if(isset($va['ratio'])){
$va['increment_ratio'] = 0;
}else{
$va['ratio'] = 0;
}
//
if($is_export){
//J3*(K3+L3)+M3-N3
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
$count['sum_money_exp'] .= "O{$line}+";
$count['platform_amount_exp'] .= "J{$line}+";
}else{
$count['platform_amount'] += $va['pay_amount'];
$count['sum_money'] += $va['sum_money'];
}
}
$v['statement_count'] = count($v['statement_info']);
}
if($is_export){
$count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+");
$count["sum_money"] = "=".trim($count["sum_money_exp"],"+");
}
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);
$this->display("viewPuPool");
}
//下游汇总结算查看
protected function viewPcPool(&$infolist,$is_export){
@ -599,7 +621,10 @@ class CompanyStatementPoolController extends ThinkController
default:
break;
}
//
if($info['platform_amount'] <= 0){
$optist = array_diff($optist, ["viewPool"]);
}
if(empty($info['ext_file'])){
//未上传凭证
$optist = array_diff($optist, ["viewVoucher", "editVoucher"]);

@ -123,44 +123,59 @@
<tr>
<td rowspan="{$com.statement_count}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.nickname}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_type_str}</td>
<td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['ratio']}%</td>
<td>{$com['statement_info'][0]['increment_ratio']}%</td>
<td>{$com['statement_info'][0]['fax_ratio']}%</td>
<td>{$com['statement_info'][0]['d_statement_money']}</td>
<td rowspan="{$com.statement_count}">{$com.fine}</td>
<td rowspan="{$com.statement_count}">{$com.reward}</td>
<td rowspan="{$com.statement_count}">{$com.statement_money}</td>
<td rowspan="{$com.statement_count}">{$com.settlement_contact}</td>
<td>{$com['statement_info'][0]['game_type_name']}</td>
<td>{$com['statement_info'][0]['statement_begin_time']} ~ {$com['statement_info'][0]['statement_end_time']}</td>
<td rowspan="{$com.statement_count}">{$com.renark}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['increment_ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['reward']}</td>
<td>{$com['statement_info'][0]['fine']}</td>
<td>{$com['statement_info'][0]['sum_money']}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
<td rowspan="{$com.statement_count}"></td>
<td rowspan="{$com.statement_count}">{$com.remark}</td>
</tr>
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<td>{$it['game_name']}</td>
<td>{$it['pay_amount']}</td>
<td>{$it['ratio']}%</td>
<td>{$it['increment_ratio']}%</td>
<td>{$it['fax_ratio']}%</td>
<td>{$it['d_statement_money']}</td>
<td>{$it['game_type_name']}</td>
<td>{$it['statement_begin_time']} ~ {$it['statement_end_time']}</td>
<td>{$it['pay_amount']}</td>
<td>{$it['ratio']|default=0}%</td>
<td>{$it['increment_ratio']|default=0}%</td>
<td>{$it['reward']}</td>
<td>{$it['fine']}</td>
<td>{$it['sum_money']}</td>
</tr>
</if>
</foreach>
</foreach>
<tr>
<td colspan=3 >合计:</td>
<td colspan=9 >合计:</td>
<td>{$count.platform_amount}</td>
<td></td>
<td></td>
<td></td>
<td>{$count.d_statement_money}</td>
<td>{$count.fine}</td>
<td>{$count.reward}</td>
<td>{$count.statement_money}</td>
<td></td>
<td>{$count.sum_money}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>

Loading…
Cancel
Save