AuctionApply.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/02
  6. */
  7. namespace app\admin\model\auction;
  8. use crmeb\traits\ModelTrait;
  9. use crmeb\basic\BaseModel;
  10. /**
  11. * 场馆 Model
  12. * Class WechatNews
  13. * @package app\admin\model\wechat
  14. */
  15. class AuctionApply extends BaseModel
  16. {
  17. use ModelTrait;
  18. protected $pk = 'id';
  19. protected $name = 'auction_apply';
  20. protected $autoWriteTimestamp = true;
  21. public static function list($where)
  22. {
  23. $model = self::alias('a')
  24. ->field('a.*, u.nickname,u.avatar as image')
  25. ->order('a.id DESC')
  26. ->leftJoin('user u', 'a.uid = u.uid');
  27. if ($where['auction']) $model->where('u.nickname', 'like', '%'.$where['auction'].'%');
  28. $data['count'] = $model->count();
  29. if ($where['page'] && $where['limit']){
  30. $model->page($where['page'], $where['limit']);
  31. }else{
  32. $model->page(20, 1);
  33. }
  34. $list = $model->select();
  35. $data['data'] = empty($list) ? [] : $list->toArray();
  36. return $data;
  37. }
  38. }