Qc.php 634 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\controller\WeChart;
  4. use think\Db;
  5. class Qc{
  6. function index()
  7. {
  8. $sql = "SELECT uid , count(id) as num FROM `user_sign` where `month` = 11 GROUP BY uid HAVING num > 6 ORDER BY num desc";
  9. $list = Db::query($sql);
  10. foreach ($list as $lv)
  11. {
  12. $sign_data = Db::table('user_sign')
  13. ->where('uid',$lv['uid'])
  14. ->where('month','11')
  15. ->order('id asc')
  16. ->limit(7)
  17. ->select();
  18. var_dump($sign_data[6]['id']);
  19. }
  20. var_dump($list);
  21. }
  22. }