Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
5c968ee3
Commit
5c968ee3
authored
Oct 22, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页修改
parent
c7f5bb74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
ApplicationController.php
api/controllers/ApplicationController.php
+1
-1
ApplicationBusiness.php
common/business/ApplicationBusiness.php
+8
-4
No files found.
api/controllers/ApplicationController.php
View file @
5c968ee3
...
...
@@ -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
;
...
...
common/business/ApplicationBusiness.php
View file @
5c968ee3
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment