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

后台订单列表优化

@@ -31,16 +31,18 @@ class UsersController extends AdminBaseController{ @@ -31,16 +31,18 @@ class UsersController extends AdminBaseController{
31 public function over_count() { 31 public function over_count() {
32 $income = Db::name('money_income')->select(); 32 $income = Db::name('money_income')->select();
33 $income = collection($income)->toArray(); 33 $income = collection($income)->toArray();
34 - $ids = []; 34 + $ids = $user_ids = [];
35 $money = 0; 35 $money = 0;
36 foreach ($income as $k=>$v) { 36 foreach ($income as $k=>$v) {
37 $indent = Db::name('indent')->where('id',$v['indent_id'])->find(); 37 $indent = Db::name('indent')->where('id',$v['indent_id'])->find();
38 if(!$indent) { 38 if(!$indent) {
39 $ids[] = $v['id']; 39 $ids[] = $v['id'];
  40 + $user_ids[] = $v['uid'];
40 $money += $v['money']; 41 $money += $v['money'];
41 } 42 }
42 } 43 }
43 echo implode(',',$ids).'<br/>'; 44 echo implode(',',$ids).'<br/>';
  45 + echo implode(',',$user_ids).'<br/>';
44 echo $money; 46 echo $money;
45 } 47 }
46 48