Formid.php 740 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\store\model\wxapp;
  3. use app\common\model\wxapp\Formid as FormidModel;
  4. /**
  5. * form_id 模型
  6. * Class Formid
  7. * @package app\store\model\wxapp
  8. */
  9. class Formid extends FormidModel
  10. {
  11. /**
  12. * 获取活跃用户列表
  13. * @return \think\Paginator
  14. * @throws \think\exception\DbException
  15. */
  16. public function getUserList()
  17. {
  18. return $this->with(['user'])
  19. ->field(['user_id', 'count(id) AS total_formid'])
  20. ->where('is_used', '=', 0)
  21. ->where('expiry_time', '>', time())
  22. ->group('user_id')
  23. ->order(['total_formid' => 'desc'])
  24. ->paginate(15, false, [
  25. 'query' => request()->request()
  26. ]);
  27. }
  28. }