正在显示
1 个修改的文件
包含
12 行增加
和
0 行删除
@@ -24,6 +24,18 @@ class TestController extends HomeBaseController | @@ -24,6 +24,18 @@ 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"); | ||
28 | + $a = []; | ||
29 | + foreach ($indent_data as $v) { | ||
30 | + if($v['count'] == 4) { | ||
31 | + $money = Db::name('money_income')->where('money','>',0)->where('indent_id',$v['indent_id'])->count(); | ||
32 | + if($money >= 2) { | ||
33 | + $v['nickname'] = Db::name('user')->where('id',$v['uid'])->value('user_nickname'); | ||
34 | + $a[] = $v; | ||
35 | + } | ||
36 | + } | ||
37 | + } | ||
38 | + print_r($a);exit; | ||
27 | // $data = Db::name('my_user')->where(['status'=>3,'inviter_phone'=>['neq','']])->select()->toArray(); | 39 | // $data = Db::name('my_user')->where(['status'=>3,'inviter_phone'=>['neq','']])->select()->toArray(); |
28 | // foreach($data as $key => $vo){ | 40 | // foreach($data as $key => $vo){ |
29 | // $result = Db::name('my_user')->where(['phone'=>$vo['inviter_phone']])->value('id'); | 41 | // $result = Db::name('my_user')->where(['phone'=>$vo['inviter_phone']])->value('id'); |
-
请 注册 或 登录 后发表评论