Merge branch 'hotfix/statement_ratio_change' of wmtx/platform into master

优化结算
master
廖金灵 5 years ago committed by Gogs
commit edae05c50e

@ -55,7 +55,7 @@ class CompanyStatementLackController extends ThinkController
$map['company_type'] = $_REQUEST['company_type']; $map['company_type'] = $_REQUEST['company_type'];
} }
if(isset($_REQUEST['company_name'])){ if(isset($_REQUEST['company_name'])){
$map['company_name'] =["LIKE","%{$_REQUEST['company_id']}%"]; $map['company_name'] =["LIKE","%{$_REQUEST['company_name']}%"];
} }
if(isset($_REQUEST['statement_pool_num'])){ if(isset($_REQUEST['statement_pool_num'])){
$map['statement_pool_num'] =["LIKE","%{$_REQUEST['statement_pool_num']}%"]; $map['statement_pool_num'] =["LIKE","%{$_REQUEST['statement_pool_num']}%"];

@ -207,7 +207,7 @@ class CompanyStatementPoolController extends ThinkController
//获取基本信息 //获取基本信息
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select(); $infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
//获取母单 //获取母单
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status')->where("id={$id}")->find(); $pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment')->where("id={$id}")->find();
$statement_num = $pool_info['statement_num']; $statement_num = $pool_info['statement_num'];
$this->assign("title",$statement_num); $this->assign("title",$statement_num);
$this->assign("pool_status",$pool_info['verify_status']); $this->assign("pool_status",$pool_info['verify_status']);
@ -226,12 +226,12 @@ class CompanyStatementPoolController extends ThinkController
$infolist =array_merge($infolist,$lack_info); $infolist =array_merge($infolist,$lack_info);
} }
$this->viewPuPool($infolist,$is_export); $this->viewPuPool($infolist,$is_export,$pool_info);
} }
} }
//个人汇总结算查看 //个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){ public function viewPuPool(&$infolist,$is_export,$pool_info){
// dd($infolist); // dd($infolist);
$line = 1; $line = 1;
$count = []; $count = [];
@ -260,26 +260,19 @@ class CompanyStatementPoolController extends ThinkController
}else{ }else{
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; $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{ }else{
$count['platform_amount'] += $va['pay_amount']; $count['platform_amount'] += $va['pay_amount'];
$count['sum_money'] += $va['sum_money']; $count['sum_money'] += $va['sum_money'];
} }
} }
$v['statement_count'] = count($v['statement_info']); $v['statement_count'] = count($v['statement_info']);
} }
if($is_export){ if($is_export){
$platform_amount_exp = trim($count["platform_amount_exp"],"+"); $count["platform_amount"] = "=SUM(J2:J".$line.")";
$sum_money_exp = trim($count["sum_money_exp"],"+"); $count["sum_money"] = "=SUM(O2:O".$line.")";
if(empty($platform_amount_exp)){ $platform_amount_exp = 0;}
if(empty($sum_money_exp)){ $sum_money_exp = 0;}
$count["platform_amount"] = "=".$platform_amount_exp;
$count["sum_money"] = "=".$sum_money_exp;
} }
$this->assign("data",$infolist); $this->assign("data",$infolist);
$this->assign("is_payment",$pool_info['is_payment']);
$this->assign("count",$count); $this->assign("count",$count);
$this->assign("is_export",$is_export); $this->assign("is_export",$is_export);
$this->display("CompanyStatementPool/viewPuPool"); $this->display("CompanyStatementPool/viewPuPool");

@ -408,8 +408,9 @@ class CompanyStatementSetController extends Controller {
//金额为0不补点 //金额为0不补点
continue; continue;
} }
if($add_data['platform_amount'] <= 0){ if($add_data['platform_amount'] == 0){
return; //全等于0表示没有流水小于0依旧要结算
return;
} }
//添加 //添加
if($recount && $company_id !== false){ if($recount && $company_id !== false){

@ -111,10 +111,17 @@
<th>奖励</th> <th>奖励</th>
<th>罚款</th> <th>罚款</th>
<th>结算金额</th> <th>结算金额</th>
<th>开户名</th> <if condition="$is_payment eq 2">
<th>银行卡号</th> <th>开户名</th>
<th>开户支行</th> <th>银行卡号</th>
<th>帐户类型</th> <th>开户支行</th>
<th>帐户类型</th>
</if>
<if condition="$is_payment eq 1">
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
</if>
<th>备注</th> <th>备注</th>
<th>是否结算</th> <th>是否结算</th>
<if condition="!$is_export"> <if condition="!$is_export">
@ -150,10 +157,18 @@
<td>{$com['statement_info'][0]['fine']}</td> <td>{$com['statement_info'][0]['fine']}</td>
<td>{$com['statement_info'][0]['sum_money']}</td> <td>{$com['statement_info'][0]['sum_money']}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td> <if condition="$is_payment eq 2">
<td rowspan="{$com.statement_count}">&nbsp;{$com.company_info.bank_account}</td> <td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td> <td rowspan="{$com.statement_count}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}"></td> <td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
<td rowspan="{$com.statement_count}"></td>
</if>
<if condition="$is_payment eq 1">
<td rowspan="{$com.statement_count}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td>
</if>
<td rowspan="{$com.statement_count}">{$com.remark}</td> <td rowspan="{$com.statement_count}">{$com.remark}</td>
<td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td> <td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td>
<if condition="!$is_export"> <if condition="!$is_export">
@ -200,11 +215,16 @@
<td></td> <td></td>
<td></td> <td></td>
<td>{$count.sum_money|default=0}</td> <td>{$count.sum_money|default=0}</td>
<if condition="$is_payment eq 2">
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
</if>
<if condition="$is_payment eq 1">
<td></td>
<td></td>
</if>
<td></td> <td></td>
<td></td> <td></td>
<if condition="!$is_export"> <if condition="!$is_export">

@ -344,22 +344,6 @@
<span class="notice-text">显示推广员的平台币余额,推广员平台币用于会长代充或者转移给下级推广员</span> <span class="notice-text">显示推广员的平台币余额,推广员平台币用于会长代充或者转移给下级推广员</span>
</td> </td>
</tr> </tr>
<if condition="$data['level'] eq 1">
<tr>
<td class="l">结算模式:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" value="1" name="settlement_type" <eq name="data['settlement_type']" value="1">checked="checked"</eq>>周结
</label>
<label>
<input type="radio" value="2" name="settlement_type" <eq name="data['settlement_type']" value="2">checked="checked"</eq>>月结
</label>
</span>
<span class="notice-text">会长推广结算模式</span>
</td>
</tr>
</if>
</tbody> </tbody>
</table> </table>
</div> </div>

Loading…
Cancel
Save