推广平台->数据管理-订单查询|数据管理-充值统计|财务管理-结算明细--新增合计

master
chenxiaojun 5 years ago
commit 5b8c016a9b

@ -223,9 +223,12 @@ class FinanceController extends BaseController
->page($page, $row) ->page($page, $row)
->select(); ->select();
$count = $model->where($map)->count(); $count = $model->where($map)->count();
$total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income')
->where($map) ->where($map)
->find(); ->find();
$total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount'];
$total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount'];
$total['income'] = empty($total['income']) ? 0 : $total['income'];
$total['income'] = bcdiv($total['income'], 100, 2); $total['income'] = bcdiv($total['income'], 100, 2);
//提现状态 //提现状态

@ -182,13 +182,8 @@
<td>--</td> <td>--</td>
<td>--</td> <td>--</td>
<td>{$total.pay_amount}</td> <td>{$total.pay_amount}</td>
<if condition="$total.pay_way eq -1"> <td>{$total.direct_pay_amount}</td>
<td>0.00</td> <td>{$total.inner_pay_amount}</td>
<td>{$total.pay_amount}</td>
<else/>
<td>{$total.pay_amount}</td>
<td>0.00</td>
</if>
<td>--</td> <td>--</td>
<td>{$total.income}</td> <td>{$total.income}</td>
<td>--</td> <td>--</td>

Loading…
Cancel
Save