作者 何书鹏
1 个管道 的构建 通过 耗费 4 秒

分页参数完善

@@ -89,7 +89,7 @@ class Category extends Api @@ -89,7 +89,7 @@ class Category extends Api
89 */ 89 */
90 public function goods() 90 public function goods()
91 { 91 {
92 - $rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数 92 + $rows = $this->request->request('rows',null);// 每页条数
93 $page = $this->request->request('page',1);// 页码 93 $page = $this->request->request('page',1);// 页码
94 $category_id = $this->request->request('category_id'); 94 $category_id = $this->request->request('category_id');
95 $category = $this->model->get($category_id); 95 $category = $this->model->get($category_id);
@@ -107,7 +107,7 @@ class Index extends Api @@ -107,7 +107,7 @@ class Index extends Api
107 */ 107 */
108 public function searchGoodsList() 108 public function searchGoodsList()
109 { 109 {
110 - $rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数 110 + $rows = $this->request->request('rows',null);// 每页条数
111 $page = $this->request->request('page',1);// 页码 111 $page = $this->request->request('page',1);// 页码
112 $keywords = $this->request->request('keywords',''); 112 $keywords = $this->request->request('keywords','');
113 $list = Goods::getList(['goods_name'=>['like','%'.$keywords.'%']],$page,$rows); 113 $list = Goods::getList(['goods_name'=>['like','%'.$keywords.'%']],$page,$rows);
@@ -155,7 +155,7 @@ class Index extends Api @@ -155,7 +155,7 @@ class Index extends Api
155 */ 155 */
156 public function goodsList() 156 public function goodsList()
157 { 157 {
158 - $rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数 158 + $rows = $this->request->request('rows',null);// 每页条数
159 $page = $this->request->request('page',1);// 页码 159 $page = $this->request->request('page',1);// 页码
160 $category_id = $this->request->request('category_id');// 分类id 160 $category_id = $this->request->request('category_id');// 分类id
161 empty($category_id) && $this->error(__('参数不合法!')); 161 empty($category_id) && $this->error(__('参数不合法!'));
@@ -185,7 +185,7 @@ class Index extends Api @@ -185,7 +185,7 @@ class Index extends Api
185 */ 185 */
186 public function memberGoodsList() 186 public function memberGoodsList()
187 { 187 {
188 - $rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数 188 + $rows = $this->request->request('rows',null);// 每页条数
189 $page = $this->request->request('page',1);// 页码 189 $page = $this->request->request('page',1);// 页码
190 $list = Goods::getList(['ismember'=>'1'],$page,$rows); 190 $list = Goods::getList(['ismember'=>'1'],$page,$rows);
191 // 返回结果 191 // 返回结果
@@ -248,7 +248,7 @@ class Index extends Api @@ -248,7 +248,7 @@ class Index extends Api
248 public function appraiseList() 248 public function appraiseList()
249 { 249 {
250 // 商品id 250 // 商品id
251 - $rows = $this->request->request('rows',config('paginate.list_rows')); 251 + $rows = $this->request->request('rows',null);
252 $page = $this->request->request('page',1); 252 $page = $this->request->request('page',1);
253 $goods_id = $this->request->request('goods_id'); 253 $goods_id = $this->request->request('goods_id');
254 $list = \app\common\model\Appraise::getList(['goods_id'=>$goods_id],$page,$rows); 254 $list = \app\common\model\Appraise::getList(['goods_id'=>$goods_id],$page,$rows);
@@ -177,7 +177,7 @@ class User extends Api @@ -177,7 +177,7 @@ class User extends Api
177 }) 177 })
178 */ 178 */
179 public function scoreLog(){ 179 public function scoreLog(){
180 - $rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数 180 + $rows = $this->request->request('rows',null);// 每页条数
181 $page = $this->request->request('page',1);// 页码 181 $page = $this->request->request('page',1);// 页码
182 $list = $this->model->scoreLog($this->user['id'],$page,$rows); 182 $list = $this->model->scoreLog($this->user['id'],$page,$rows);
183 $this->success(__('成功'),array_merge([ 183 $this->success(__('成功'),array_merge([
@@ -36,7 +36,7 @@ class Appraise extends Model @@ -36,7 +36,7 @@ class Appraise extends Model
36 /** 36 /**
37 * 评价列表 37 * 评价列表
38 */ 38 */
39 - public static function getList($where,$page,$rows=15) 39 + public static function getList($where,$page,$rows)
40 { 40 {
41 $list = self::with(['user']) 41 $list = self::with(['user'])
42 ->where($where) 42 ->where($where)
@@ -80,7 +80,7 @@ class Goods extends Model @@ -80,7 +80,7 @@ class Goods extends Model
80 /** 80 /**
81 * 商品列表 81 * 商品列表
82 */ 82 */
83 - public static function getList($where,$page,$rows=15) 83 + public static function getList($where,$page,$rows)
84 { 84 {
85 $list = self::where('issale','1') 85 $list = self::where('issale','1')
86 ->where($where) 86 ->where($where)
@@ -54,7 +54,7 @@ class User extends Model @@ -54,7 +54,7 @@ class User extends Model
54 /** 54 /**
55 * 积分记录 55 * 积分记录
56 */ 56 */
57 - public function scoreLog($user_id,$page,$rows=15) 57 + public function scoreLog($user_id,$page,$rows)
58 { 58 {
59 $list = ScoreLog::where('user_id',$user_id) 59 $list = ScoreLog::where('user_id',$user_id)
60 ->order(['createtime' => 'desc']) 60 ->order(['createtime' => 'desc'])