正在显示
2 个修改的文件
包含
16 行增加
和
0 行删除
@@ -41,6 +41,18 @@ class StatisticalController extends AdminBaseController{ | @@ -41,6 +41,18 @@ class StatisticalController extends AdminBaseController{ | ||
41 | $salesman_money += $val['money']; | 41 | $salesman_money += $val['money']; |
42 | } | 42 | } |
43 | $this -> assign('salesman_money',$salesman_money); | 43 | $this -> assign('salesman_money',$salesman_money); |
44 | + // 业务员总余额 | ||
45 | + $users_where = [ | ||
46 | + 'a.create_time' => ['>=', 0], | ||
47 | + 'a.status' => ['in',[2,3]] | ||
48 | + ]; | ||
49 | + $total_balance = Db::name('my_user') -> alias('a') | ||
50 | + ->field('a.*,b.user_nickname') | ||
51 | + ->join('user b','a.uid = b.id','LEFT') | ||
52 | + ->where($users_where) | ||
53 | + ->order(['a.balance'=>'DESC','a.create_time'=>'DESC']) | ||
54 | + ->sum('a.balance'); | ||
55 | + $this -> assign('total_balance',$total_balance); | ||
44 | //显示平台抽成收益 | 56 | //显示平台抽成收益 |
45 | $income = Db::name('income_money') -> where($where3) -> select(); | 57 | $income = Db::name('income_money') -> where($where3) -> select(); |
46 | $income_money = 0; | 58 | $income_money = 0; |
@@ -33,6 +33,10 @@ | @@ -33,6 +33,10 @@ | ||
33 | <td>{$salesman_money}</td> | 33 | <td>{$salesman_money}</td> |
34 | </tr> | 34 | </tr> |
35 | <tr> | 35 | <tr> |
36 | + <td>业务员总余额</td> | ||
37 | + <td>{$total_balance}</td> | ||
38 | + </tr> | ||
39 | + <tr> | ||
36 | <td>平台抽成收益</td> | 40 | <td>平台抽成收益</td> |
37 | <td>{$income_money}</td> | 41 | <td>{$income_money}</td> |
38 | </tr> | 42 | </tr> |
-
请 注册 或 登录 后发表评论