1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\api\controller;
- use app\api\controller\WeChart;
- use think\Db;
- class Qc{
- function index()
- {
- $sql = "SELECT uid , count(id) as num FROM `user_sign` where `month` = 11 GROUP BY uid HAVING num > 6 ORDER BY num desc";
- $list = Db::query($sql);
- foreach ($list as $lv)
- {
- $sign_data = Db::table('user_sign')
- ->where('uid',$lv['uid'])
- ->where('month','11')
- ->order('id asc')
- ->limit(7)
- ->select();
- var_dump($sign_data[6]['id']);
- }
- var_dump($list);
- }
- }
|