AuctionDeliver.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 AuctionDeliver extends BaseModel
  16. {
  17. use ModelTrait;
  18. protected $pk = 'id';
  19. protected $name = 'auction_deliver';
  20. protected $autoWriteTimestamp = true;
  21. public static function list($where)
  22. {
  23. $model = self::alias('a')
  24. ->field('a.*,b.nickname')
  25. ->order('a.id DESC')
  26. ->leftJoin('user b', 'a.uid = b.uid');
  27. if ($where['status'] > 0) $model = $model->where('a.status', $where['status'] -1);
  28. if ($where['name']) $model = $model->where('b.nickname|b.uid', '=', $where['name']);
  29. if ($where['product']) $model = $model->where('a.product', $where['name']);
  30. if ($where['page'] && $where['limit']){
  31. $model->page($where['page'], $where['limit']);
  32. }else{
  33. $model->page(20, 1);
  34. }
  35. $data['count'] = $model->count();
  36. $list = $model->select()->toArray();
  37. $data['data'] = $list;
  38. return $data;
  39. }
  40. }