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
f58a5430
Commit
f58a5430
authored
Feb 05, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into develop
parents
bbd14bd7
42b42f41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
ExploreController.php
api/controllers/ExploreController.php
+2
-2
ExploreApp.php
common/models/psources/ExploreApp.php
+9
-5
ExploreAppController.php
wallet/controllers/ExploreAppController.php
+1
-1
No files found.
api/controllers/ExploreController.php
View file @
f58a5430
...
@@ -31,7 +31,7 @@ class ExploreController extends BaseController
...
@@ -31,7 +31,7 @@ class ExploreController extends BaseController
foreach
(
$app_category_model
as
$key
=>
$val
)
{
foreach
(
$app_category_model
as
$key
=>
$val
)
{
unset
(
$val
->
apps
);
unset
(
$val
->
apps
);
$val
->
name
=
isset
(
$val
->
name
[
$this
->
lang
])
?
$val
->
name
[
$this
->
lang
]
:
''
;
$val
->
name
=
isset
(
$val
->
name
[
$this
->
lang
])
?
$val
->
name
[
$this
->
lang
]
:
''
;
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan'
)
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan
, email, phone, real_name
'
)
->
where
([
'app_category_id'
=>
(
int
)
$val
->
id
,
'status'
=>
ExploreApp
::
STATUS_ON
])
->
where
([
'app_category_id'
=>
(
int
)
$val
->
id
,
'status'
=>
ExploreApp
::
STATUS_ON
])
->
orderBy
(
'sort'
)
->
orderBy
(
'sort'
)
->
limit
(
$val
->
limit
)
->
limit
(
$val
->
limit
)
...
@@ -111,7 +111,7 @@ class ExploreController extends BaseController
...
@@ -111,7 +111,7 @@ class ExploreController extends BaseController
$id_arr
=
explode
(
','
,
$ids
);
$id_arr
=
explode
(
','
,
$ids
);
$order
=
"FIELD(`id`,
$ids
)"
;
$order
=
"FIELD(`id`,
$ids
)"
;
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan'
)
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan
, email, phone, real_name
'
)
->
where
([
'status'
=>
ExploreApp
::
STATUS_ON
])
->
where
([
'status'
=>
ExploreApp
::
STATUS_ON
])
->
andWhere
([
'in'
,
'id'
,
$id_arr
])
->
andWhere
([
'in'
,
'id'
,
$id_arr
])
->
orderBy
([
$order
=>
true
])
->
orderBy
([
$order
=>
true
])
...
...
common/models/psources/ExploreApp.php
View file @
f58a5430
...
@@ -30,8 +30,9 @@ class ExploreApp extends BaseActiveRecord
...
@@ -30,8 +30,9 @@ class ExploreApp extends BaseActiveRecord
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'name'
,
'icon'
,
'app_url'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
],
'required'
],
[[
'name'
,
'icon'
,
'app_url'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
,
'email'
,
'phone'
,
'real_name'
],
'required'
],
[[
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
],
'integer'
],
[[
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
,
'email'
,
'phone'
,
'real_name'
],
'integer'
],
[[
'email'
,
'phone'
,
'real_name'
],
'in'
,
'range'
=>
array
(
0
,
1
)],
[
'slogan'
,
'string'
,
'max'
=>
50
],
[
'slogan'
,
'string'
,
'max'
=>
50
],
[[
'slogan'
],
'safe'
],
[[
'slogan'
],
'safe'
],
[[
'icon'
],
'url'
]
[[
'icon'
],
'url'
]
...
@@ -47,15 +48,18 @@ class ExploreApp extends BaseActiveRecord
...
@@ -47,15 +48,18 @@ class ExploreApp extends BaseActiveRecord
'slogan'
=>
'应用宣传语'
,
'slogan'
=>
'应用宣传语'
,
'type'
=>
'应用类型'
,
'type'
=>
'应用类型'
,
'sort'
=>
'应用排序'
,
'sort'
=>
'应用排序'
,
'status'
=>
'应用状态'
'status'
=>
'应用状态'
,
'phone'
=>
'准入条件 - 手机'
,
'email'
=>
'准入条件 - 邮箱'
,
'real_name'
=>
'准入条件 - 实名'
];
];
}
}
public
function
scenarios
()
public
function
scenarios
()
{
{
$scenarios
=
[
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'icon'
,
'app_url'
,
'slogan'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
],
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'icon'
,
'app_url'
,
'slogan'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
,
'email'
,
'phone'
,
'real_name'
],
self
::
SCENARIOS_UPDATE
=>
[
'id'
,
'name'
,
'icon'
,
'app_url'
,
'slogan'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
],
self
::
SCENARIOS_UPDATE
=>
[
'id'
,
'name'
,
'icon'
,
'app_url'
,
'slogan'
,
'type'
,
'sort'
,
'status'
,
'platform_id'
,
'app_category_id'
,
'email'
,
'phone'
,
'real_name'
],
];
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
}
...
...
wallet/controllers/ExploreAppController.php
View file @
f58a5430
...
@@ -232,7 +232,7 @@ class ExploreAppController extends BaseController
...
@@ -232,7 +232,7 @@ class ExploreAppController extends BaseController
if
(
Yii
::
$app
->
request
->
isGet
)
{
if
(
Yii
::
$app
->
request
->
isGet
)
{
$id
=
Yii
::
$app
->
request
->
get
(
'id'
);
$id
=
Yii
::
$app
->
request
->
get
(
'id'
);
$data
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, app_url, slogan, type, sort, status'
)
->
where
([
'platform_id'
=>
$platform_id
,
'id'
=>
$id
])
->
asArray
()
->
one
();
$data
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, app_url, slogan, type, sort, status
, email, phone, real_name
'
)
->
where
([
'platform_id'
=>
$platform_id
,
'id'
=>
$id
])
->
asArray
()
->
one
();
goto
doEnd
;
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