正在显示
1 个修改的文件
包含
2 行增加
和
3 行删除
@@ -24,12 +24,11 @@ class TestController extends HomeBaseController | @@ -24,12 +24,11 @@ class TestController extends HomeBaseController | ||
24 | * @throws \think\exception\PDOException | 24 | * @throws \think\exception\PDOException |
25 | */ | 25 | */ |
26 | public function test(){ | 26 | public function test(){ |
27 | - $indent_data = Db::query("select id,uid,indent_id,count(indent_id) count from `cmf_money_income` group by indent_id having count(indent_id) >= 4 order by indent_id desc"); | 27 | + $indent_data = Db::query("select id,uid,money,indent_id,count(indent_id) count from `cmf_money_income` group by indent_id having count(indent_id) >= 4 order by indent_id desc"); |
28 | $a = []; | 28 | $a = []; |
29 | foreach ($indent_data as $v) { | 29 | foreach ($indent_data as $v) { |
30 | if($v['count'] == 4) { | 30 | if($v['count'] == 4) { |
31 | - $money = Db::name('money_income')->where('uid',$v['uid'])->where('money','>',0)->where('indent_id',$v['indent_id'])->count(); | ||
32 | - if($money) { | 31 | + if($v['money'] > 0) { |
33 | $v['nickname'] = Db::name('user')->where('id',$v['uid'])->value('user_nickname'); | 32 | $v['nickname'] = Db::name('user')->where('id',$v['uid'])->value('user_nickname'); |
34 | $a[] = $v; | 33 | $a[] = $v; |
35 | } | 34 | } |
-
请 注册 或 登录 后发表评论