field($field) ->order($order) ->paginate(['list_rows'=>$pageSize,'query' => request()->param()]); $page = $list->render(); $data['list'] = $list->toArray()['data']; $data['count']=$list->total(); $data['last_page']=$list->toArray()['last_page']; $data['page']=$page; return $data; } /** * 获取列表 不分页 */ public static function getAllList($where = [],$field='*',$order='',$limit = '0') { $data = self::where($where) ->field($field) ->order($order) ->limit($limit) ->select(); return $data; } /** * 获取单条数据 */ public static function getInfo($where = [],$field = '*'){ $data = self::where($where) ->field($field) ->find(); return $data; } /* * 获取类型 */ public static function getStatusTextAttr($value,$data) { $status = [1=>'未使用',2=>'已使用',3=>'已过期',4=>'已删除']; return $status[$data['status']]; } }