123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- /**
- *
- * @author: xaboy<365615158@qq.com>
- * @day: 2017/11/02
- */
- namespace app\admin\model\auction;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- /**
- * 场馆 Model
- * Class WechatNews
- * @package app\admin\model\wechat
- */
- class AuctionDeliver extends BaseModel
- {
- use ModelTrait;
- protected $pk = 'id';
- protected $name = 'auction_deliver';
- protected $autoWriteTimestamp = true;
- public static function list($where)
- {
- $model = self::alias('a')
- ->field('a.*,b.nickname')
- ->order('a.id DESC')
- ->leftJoin('user b', 'a.uid = b.uid');
- if ($where['status'] > 0) $model = $model->where('a.status', $where['status'] -1);
- if ($where['name']) $model = $model->where('b.nickname|b.uid', '=', $where['name']);
- if ($where['product']) $model = $model->where('a.product', $where['name']);
- if ($where['page'] && $where['limit']){
- $model->page($where['page'], $where['limit']);
- }else{
- $model->page(20, 1);
- }
- $data['count'] = $model->count();
- $list = $model->select()->toArray();
- $data['data'] = $list;
- return $data;
- }
- }
|