新增全量查看

master
chenzhi 5 years ago
parent a69b21dd14
commit 31b1c771a1

@ -118,6 +118,9 @@ class CompanyStatementPoolController extends ThinkController
$v['company_type_str'] = $this->CompanyType[$v['company_type']];
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
$v['can_export'] = $v['statement_money'] == 0 ? "0" : '1';
if($v['company_type'] == 2){
$v['can_export'] = 1;
}
$v['op_time'] = date('Y-m-d H:i:s',$v['op_time']);
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
@ -201,9 +204,11 @@ class CompanyStatementPoolController extends ThinkController
$is_export = true;
}
//获取基本信息
$infolist = M("company_statement_info","tab_")->where("pool_id = '{$id}'")->select();
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
//获取母单
$statement_num = M("company_statement_pool","tab_")->field('statement_num')->where("id={$id}")->find()['statement_num'];
$statement_num =
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids')->where("id={$id}")->find();
$statement_num = $pool_info['statement_num'];
$this->assign("title",$statement_num);
if($infolist[0]['company_type'] == 3){
@ -213,12 +218,20 @@ class CompanyStatementPoolController extends ThinkController
//下游公司
$this->viewPcPool($infolist,$is_export);
}else{
//获取母单
if(!empty($pool_info['create_lack_ids'])){
$l_ids = $pool_info['create_lack_ids'];
$lack_info = M("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
$infolist += $lack_info;
}
$this->viewPuPool($infolist,$is_export);
}
}
//个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){
// dd($infolist);
$line = 1;
$count = [];
//获取对接人
@ -246,14 +259,17 @@ class CompanyStatementPoolController extends ThinkController
}else{
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
}
if($v['st'] == 1){
$count['sum_money_exp'] .= "O{$line}+";
$count['platform_amount_exp'] .= "J{$line}+";
}
}else{
if($v['st'] == 1){
$count['platform_amount'] += $va['pay_amount'];
$count['sum_money'] += $va['sum_money'];
}
}
}
$v['statement_count'] = count($v['statement_info']);
}
@ -868,7 +884,7 @@ class CompanyStatementPoolController extends ThinkController
break;
}
//
if($info['platform_amount'] <= 0){
if($info['platform_amount'] <= 0 && $info['company_type'] != 2){
$optist = array_diff($optist, ["viewPool"]);
}
//个人重算,上游撤销

@ -116,11 +116,15 @@
<th>开户支行</th>
<th>帐户类型</th>
<th>备注</th>
<if condition="$is_export">
<th>是否结算</th>
</if>
<th>操作</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="data" item="com">
<tr>
<tr <if condition="$com['st'] eq 0">style='color:red;'</if>>
<td rowspan="{$com.statement_count}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
@ -150,11 +154,21 @@
<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>
<if condition="$is_export">
<td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td>
</if>
<td rowspan="{$com.statement_count}">
<if condition="$com['st'] eq 1">
<a class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
</td>
</tr>
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<tr <if condition="$com['st'] eq 0">style='color:red;'</if>>
<td>{$it['game_name']}</td>
<td>{$it['game_type_name']}</td>
<td>{$it['statement_begin_time']} ~ {$it['statement_end_time']}</td>
@ -177,19 +191,20 @@
</foreach>
</foreach>
<tr>
<td colspan=9 >合计:</td>
<td>{$count.platform_amount}</td>
<td colspan=9 >合计(仅统计结算公司):</td>
<td>{$count.platform_amount|default=0}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{$count.sum_money}</td>
<td>{$count.sum_money|default=0}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

Loading…
Cancel
Save