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
5458cbb6
Commit
5458cbb6
authored
Nov 11, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
05fe32a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
ExploreController.php
api/controllers/ExploreController.php
+1
-1
ExploreAppCategory.php
common/models/psources/ExploreAppCategory.php
+7
-4
ExploreAppController.php
wallet/controllers/ExploreAppController.php
+1
-1
No files found.
api/controllers/ExploreController.php
View file @
5458cbb6
...
...
@@ -22,7 +22,7 @@ class ExploreController extends BaseController
goto
doEnd
;
}
$app_category_model
=
ExploreAppCategory
::
find
()
->
where
([
'platform_id'
=>
$platform_id
])
->
all
();
$app_category_model
=
ExploreAppCategory
::
find
()
->
where
([
'platform_id'
=>
$platform_id
,
'status'
=>
ExploreAppCategory
::
STATUS_ON
])
->
all
();
foreach
(
$app_category_model
as
&
$val
)
{
unset
(
$val
->
apps
);
$val
->
name
=
$val
->
name
[
$this
->
lang
];
...
...
common/models/psources/ExploreAppCategory.php
View file @
5458cbb6
...
...
@@ -7,6 +7,8 @@ use common\core\BaseActiveRecord;
class
ExploreAppCategory
extends
BaseActiveRecord
{
const
STATUS_ON
=
1
;
//激活
const
STATUS_OFF
=
0
;
//未激活
public
static
function
getDb
()
{
...
...
@@ -26,7 +28,7 @@ class ExploreAppCategory extends BaseActiveRecord
public
function
rules
()
{
return
[
[[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
],
'required'
],
[[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
,
'status'
],
'required'
],
];
}
...
...
@@ -38,8 +40,8 @@ class ExploreAppCategory extends BaseActiveRecord
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
],
self
::
SCENARIOS_UPDATE
=>
[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
],
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
,
'status'
],
self
::
SCENARIOS_UPDATE
=>
[
'name'
,
'sort'
,
'limit'
,
'style'
,
'platform_id'
,
'status'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
@@ -50,7 +52,8 @@ class ExploreAppCategory extends BaseActiveRecord
'name'
=>
'应用分类名称'
,
'sort'
=>
'应用分类排序'
,
'limit'
=>
'该分类下首页可显示的应用数量'
,
'style'
=>
'应用分类展示样式'
'style'
=>
'应用分类展示样式'
,
'status'
=>
'应用分类状态'
];
}
...
...
wallet/controllers/ExploreAppController.php
View file @
5458cbb6
...
...
@@ -78,7 +78,7 @@ class ExploreAppController extends BaseController
if
(
Yii
::
$app
->
request
->
isGet
)
{
$id
=
Yii
::
$app
->
request
->
get
(
'id'
);
$data
=
ExploreAppCategory
::
find
()
->
select
(
'id, name, sort, limit, style'
)
->
where
([
'platform_id'
=>
$platform_id
,
'id'
=>
$id
])
->
asArray
()
->
one
();
$data
=
ExploreAppCategory
::
find
()
->
select
(
'id, name, sort, limit, style
, status
'
)
->
where
([
'platform_id'
=>
$platform_id
,
'id'
=>
$id
])
->
asArray
()
->
one
();
goto
doEnd
;
}
...
...
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