* @day: 2017/12/25 */ namespace app\admin\model\user; use crmeb\basic\BaseModel; use crmeb\traits\ModelTrait; /** * TODO 用户申请 * Class UserAddress * @package app\models\user */ class UserProduct extends BaseModel { /** * 数据表主键 * @var string */ protected $pk = 'id'; /** * 模型名称 * @var string */ protected $name = 'user_product'; use ModelTrait; protected $autoWriteTimestamp = true; public static function list($where) { $model = self::field('*')->order('id DESC'); if ($where['name'])$model->where('name' , 'like', '%'.$where['name'],'%'); $data['count'] = $model->count(); if ($where['page'] && $where['limit']){ $model->page($where['page'], $where['limit']); }else{ $model->page(20, 1); } $list = $model->select()->toArray(); $data['data'] = $list; return $data; } }