Commit 5c968ee3 authored by ZhuChunYang's avatar ZhuChunYang

首页修改

parent c7f5bb74
......@@ -22,7 +22,7 @@ class ApplicationController extends BaseController
{
$recommendData = ApplicationBusiness::getRecommendList();
$data['recommend'] =$recommendData;
$cate_app_data = ApplicationBusiness::getCategoryAppList();
$cate_app_data = ApplicationBusiness::getCategoryAppList(4);
$data['cate_app_data'] = $cate_app_data;
$result['code'] = 0;
$result['data'] = $data;
......
......@@ -34,7 +34,7 @@ class ApplicationBusiness
return $data;
}
public static function getCategoryAppList()
public static function getCategoryAppList($limit=0)
{
$data = CoinApplicationCategory::getAllList();
$cate_app_data = [];
......@@ -42,7 +42,7 @@ class ApplicationBusiness
$banner_Items = array_column($data,'banner');
$image_Items = array_merge($icon_Items,$banner_Items);
$icon_Infos = CoinImage::getItemsByIds($image_Items);
$cate_app_Infos = self::getCateAppInfo();
$cate_app_Infos = self::getCateAppInfo($limit);
foreach($data as $value){
$cate_app_item['id'] = $value['id'];
$cate_app_item['name'] = $value['name'];
......@@ -72,7 +72,7 @@ class ApplicationBusiness
* @return mixed
* 获取分类以及应用
*/
public static function getCateAppInfo()
public static function getCateAppInfo($limit=0)
{
$app_cate_Model = CoinAppCate::find();
$data = $app_cate_Model->JoinWith(['application'], false)
......@@ -90,7 +90,11 @@ class ApplicationBusiness
}
}
foreach($data as $item){
$cate_app_item[$item['cate_id']] []= $item;
if($limit && isset($cate_app_item[$item['cate_id']]) && count($cate_app_item[$item['cate_id']])>=$limit){
continue;
}else{
$cate_app_item[$item['cate_id']] []= $item;
}
}
return $cate_app_item;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment