作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

修改分页数量

@@ -16,8 +16,10 @@ class CommonController extends HomeBaseController @@ -16,8 +16,10 @@ class CommonController extends HomeBaseController
16 { 16 {
17 //七牛云域名 17 //七牛云域名
18 const domain = 'http://jinglong.springchunjia.cn/'; 18 const domain = 'http://jinglong.springchunjia.cn/';
19 - //分页数量 19 + //资料下载分页数量
20 const limit = 10; 20 const limit = 10;
  21 + //产品系列分页数量
  22 + const series_limit = 9;
21 //查找单条数据 23 //查找单条数据
22 public static function findData($table,$where,$field){ 24 public static function findData($table,$where,$field){
23 $res = Db::name($table) 25 $res = Db::name($table)
@@ -83,7 +83,7 @@ class SeriesController extends RestBaseController @@ -83,7 +83,7 @@ class SeriesController extends RestBaseController
83 //查找二级分类 83 //查找二级分类
84 $type = CommonController::selectData('type',['pid'=>$parent_id],'id'); 84 $type = CommonController::selectData('type',['pid'=>$parent_id],'id');
85 $children_ids = array_column($type,'id'); 85 $children_ids = array_column($type,'id');
86 - $limit = CommonController::limit; 86 + $limit = CommonController::series_limit;
87 $res = Db::name('series') 87 $res = Db::name('series')
88 ->whereIn('t_id',$children_ids); 88 ->whereIn('t_id',$children_ids);
89 $data = $res->field($field_series) 89 $data = $res->field($field_series)
@@ -130,7 +130,7 @@ class SeriesController extends RestBaseController @@ -130,7 +130,7 @@ class SeriesController extends RestBaseController
130 //中文 130 //中文
131 $field_series = 'id,thumbnail,title'; 131 $field_series = 'id,thumbnail,title';
132 } 132 }
133 - $limit = CommonController::limit; 133 + $limit = CommonController::series_limit;
134 $res = Db::name('series') 134 $res = Db::name('series')
135 ->where(['t_id'=>$children_id]); 135 ->where(['t_id'=>$children_id]);
136 $data = $res->field($field_series) 136 $data = $res->field($field_series)