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

调试

@@ -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 }