...
|
...
|
@@ -24,6 +24,18 @@ class TestController extends HomeBaseController |
|
|
* @throws \think\exception\PDOException
|
|
|
*/
|
|
|
public function test(){
|
|
|
$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");
|
|
|
$a = [];
|
|
|
foreach ($indent_data as $v) {
|
|
|
if($v['count'] == 4) {
|
|
|
$money = Db::name('money_income')->where('money','>',0)->where('indent_id',$v['indent_id'])->count();
|
|
|
if($money >= 2) {
|
|
|
$v['nickname'] = Db::name('user')->where('id',$v['uid'])->value('user_nickname');
|
|
|
$a[] = $v;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
print_r($a);exit;
|
|
|
// $data = Db::name('my_user')->where(['status'=>3,'inviter_phone'=>['neq','']])->select()->toArray();
|
|
|
// foreach($data as $key => $vo){
|
|
|
// $result = Db::name('my_user')->where(['phone'=>$vo['inviter_phone']])->value('id');
|
...
|
...
|
|