作者 刘朕
1 个管道 的构建 通过 耗费 17 秒

合并分支 'liuzhen' 到 'master'

后台财务统计新增业务员总余额



查看合并请求 !146
... ... @@ -41,6 +41,18 @@ class StatisticalController extends AdminBaseController{
$salesman_money += $val['money'];
}
$this -> assign('salesman_money',$salesman_money);
// 业务员总余额
$users_where = [
'a.create_time' => ['>=', 0],
'a.status' => ['in',[2,3]]
];
$total_balance = Db::name('my_user') -> alias('a')
->field('a.*,b.user_nickname')
->join('user b','a.uid = b.id','LEFT')
->where($users_where)
->order(['a.balance'=>'DESC','a.create_time'=>'DESC'])
->sum('a.balance');
$this -> assign('total_balance',$total_balance);
//显示平台抽成收益
$income = Db::name('income_money') -> where($where3) -> select();
$income_money = 0;
... ...
... ... @@ -33,6 +33,10 @@
<td>{$salesman_money}</td>
</tr>
<tr>
<td>业务员总余额</td>
<td>{$total_balance}</td>
</tr>
<tr>
<td>平台抽成收益</td>
<td>{$income_money}</td>
</tr>
... ...