| xqd
@@ -174,7 +174,7 @@ class ProductController extends Controller
|
|
|
public function productList(Request $request){
|
|
|
$limit = $request->get('limit',10);
|
|
|
$type = $request->get('type');
|
|
|
- $go = $request->get('go');
|
|
|
+ $go = $request->get('go',6);
|
|
|
$query = Product::query()
|
|
|
->with('user:id,name,nickname,avatar,company_name,company_card_color,production_project');
|
|
|
if(!empty($type)){
|
| xqd
@@ -183,8 +183,9 @@ class ProductController extends Controller
|
|
|
}
|
|
|
$list = $query->where('status',1)
|
|
|
->paginate($limit);
|
|
|
+ $num = intval(round($limit / $go));
|
|
|
$data = [
|
|
|
- 'items' => array_chunk($list->items(),$go) ,
|
|
|
+ 'items' => array_chunk($list->items(),$num),
|
|
|
'total' => $list->total(), // 总数
|
|
|
'pageSize' => $list->perPage(), // 每页数据
|
|
|
'totalPage' => $list->lastPage(),// 总页数
|