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
2fcf4ab4
Commit
2fcf4ab4
authored
5 years ago
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9de5dad8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
ApplicationController.php
api/controllers/ApplicationController.php
+10
-10
No files found.
api/controllers/ApplicationController.php
View file @
2fcf4ab4
...
...
@@ -33,17 +33,17 @@ class ApplicationController extends BaseController
$recommendData
=
ApplicationBusiness
::
getRecommendList
(
$condition
);
foreach
(
$recommendData
as
$j
=>
&
$val
){
$name_arr
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name_arr
[
$this
->
lang
]
;
$val
[
'name'
]
=
isset
(
$name_arr
[
$this
->
lang
])
?
$name_arr
[
$this
->
lang
]
:
''
;
}
$data
[
'recommend'
]
=
$recommendData
;
$cate_app_data
=
ApplicationBusiness
::
getCategoryAppList
(
$condition
);
foreach
(
$cate_app_data
as
$key
=>
&
$val
){
$name
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name
[
$this
->
lang
]
;
$val
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
if
(
!
empty
(
$val
[
'apps'
])){
foreach
(
$val
[
'apps'
]
as
$j
=>
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
]
;
$value
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
}
}
}
...
...
@@ -64,11 +64,11 @@ class ApplicationController extends BaseController
$result
[
'data'
]
=
ApplicationBusiness
::
getCategoryAppList
();
foreach
(
$result
[
'data'
]
as
$key
=>
&
$val
){
$name
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name
[
$this
->
lang
]
;
$val
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
if
(
!
empty
(
$val
[
'apps'
])){
foreach
(
$val
[
'apps'
]
as
$j
=>
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
]
;
$value
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
}
}
}
...
...
@@ -86,7 +86,7 @@ class ApplicationController extends BaseController
$result
=
ApplicationBusiness
::
appInfo
(
$id
);
$data
=
$result
[
'data'
];
$name
=
json_decode
(
$data
[
'name'
],
true
);
$data
[
'name'
]
=
$name
[
$this
->
lang
]
;
$data
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
return
[
'code'
=>
0
,
'data'
=>
$data
];
}
else
{
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'id不能为空'
];
...
...
@@ -155,7 +155,7 @@ class ApplicationController extends BaseController
$icon_Infos
=
CoinImage
::
getItemsByIds
(
$icon_Items
);
foreach
(
$appItems
as
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
]
;
$value
[
'name'
]
=
isset
(
$name
[
$this
->
lang
])
?
$name
[
$this
->
lang
]
:
''
;
if
(
$value
[
'icon'
]){
$value
[
'icon'
]
=
Yii
::
$app
->
params
[
'service'
][
'OssService'
][
'url'
]
.
$icon_Infos
[
$value
[
'icon'
]][
'file_url'
];
}
else
{
...
...
@@ -169,7 +169,7 @@ class ApplicationController extends BaseController
$app_id
=
$item
[
'app_id'
];
$cate_app_items
[
$cate_id
][
'cate_id'
]
=
$cate_id
;
$name_arr
=
json_decode
(
$item
[
'name'
],
true
);
$name
=
$name_arr
[
$this
->
lang
]
;
$name
=
isset
(
$name_arr
[
$this
->
lang
])
?
$name_arr
[
$this
->
lang
]
:
''
;
$cate_app_items
[
$cate_id
][
'name'
]
=
$name
;
$cate_app_items
[
$cate_id
][
'apps'
][]
=
$appItems
[
$app_id
];
}
...
...
@@ -191,7 +191,7 @@ class ApplicationController extends BaseController
$cate_id
=
$request
->
get
(
'cate_id'
,
''
);
if
(
$cate_id
){
$cate_info
=
CoinApplicationCategory
::
getCategoryById
(
$cate_id
);
$name
=
$cate_info
->
name
[
$this
->
lang
]
;
$name
=
isset
(
$cate_info
->
name
[
$this
->
lang
])
?
$cate_info
->
name
[
$this
->
lang
]
:
''
;
$cate_info_data
[
'id'
]
=
$cate_info
->
id
;
$cate_info_data
[
'name'
]
=
$name
;
$appItems
=
ApplicationBusiness
::
getCateAppInfo
(
0
,[[
'cate_id'
=>
$cate_id
]]);
...
...
@@ -200,7 +200,7 @@ class ApplicationController extends BaseController
foreach
(
$appItems
as
&
$value
){
$value
[
'app_user_num'
]
=
ApplicationBusiness
::
getAppUserNum
(
$value
[
'app_id'
]);
$name_arr
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name_arr
[
$this
->
lang
]
;
$value
[
'name'
]
=
isset
(
$name_arr
[
$this
->
lang
])
?
$name_arr
[
$this
->
lang
]
:
''
;
}
$cate_info_data
[
'apps'
]
=
$appItems
;
return
[
'code'
=>
0
,
'data'
=>
$cate_info_data
];
...
...
This diff is collapsed.
Click to expand it.
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