@ -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')