UserSign.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\model\user;
  12. use traits\ModelTrait;
  13. use basic\ModelBasic;
  14. class UserSign extends ModelBasic
  15. {
  16. use ModelTrait;
  17. public static function getUserSignList($where){
  18. $array = array();
  19. $model=self::alias('s')->join('User u','s.uid=u.uid');
  20. if (isset($where['title']) && $where['title']){
  21. $model=$model->where('s.uid|u.nickname','like','%'.$where['title'].'%');
  22. }
  23. $data=$model->field('s.*,u.nickname')->page((int)$where['page'],(int)$where['limit'])->order('s.add_time DESC')->select();
  24. count($data) && $data=$data->toArray();
  25. foreach ($data as &$item){
  26. $item['add_time']=date('Y-m-d H:i:s',$item['add_time']);
  27. }
  28. $count=self::count();
  29. return compact('data','count');
  30. }
  31. }