作者 李涵
1 个管道 的构建 通过 耗费 1 秒

合并分支 'li' 到 'master'

赠送积分和角色管理



查看合并请求 !604
@@ -109,8 +109,8 @@ class AdminIndexController extends AdminBaseController @@ -109,8 +109,8 @@ class AdminIndexController extends AdminBaseController
109 $son_arr = Db::name('user')->where(['parent_id' => $item['id']])->field('id')->select()->toArray(); 109 $son_arr = Db::name('user')->where(['parent_id' => $item['id']])->field('id')->select()->toArray();
110 if (!empty($son_arr)) { 110 if (!empty($son_arr)) {
111 $son_str = ''; 111 $son_str = '';
112 - foreach ($son_arr as $k => $v) {  
113 - if ($k == count($son_arr) - 1) { 112 + foreach ($son_arr as $key => $v) {
  113 + if ($key == count($son_arr) - 1) {
114 $son_str .= $v['id']; 114 $son_str .= $v['id'];
115 } else { 115 } else {
116 $son_str .= $v['id'] . ','; 116 $son_str .= $v['id'] . ',';
@@ -121,11 +121,10 @@ class AdminIndexController extends AdminBaseController @@ -121,11 +121,10 @@ class AdminIndexController extends AdminBaseController
121 'pay_type' => ['eq', 3], 121 'pay_type' => ['eq', 3],
122 'step' => ['neq', 1] 122 'step' => ['neq', 1]
123 ]; 123 ];
124 - //$data = Db::name('zj_order')->where($map)->field('sum(whole) as whole,sum(whole_num) as whole_num')->select();  
125 -// $whole = $data[0]['whole'];  
126 -// $whole_num = $data[0]['whole_num'];  
127 -// $total = $whole - $whole_num;  
128 - $total = '???'; 124 + $data = Db::name('zj_order')->where($map)->field('sum(whole) as whole,sum(whole_num) as whole_num')->select();
  125 + $whole = $data[0]['whole'];
  126 + $whole_num = $data[0]['whole_num'];
  127 + $total = $whole - $whole_num;
129 } else { 128 } else {
130 $total = 0; 129 $total = 0;
131 } 130 }