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
437d3cc1
Commit
437d3cc1
authored
Aug 21, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用查询
parent
e6cb4f80
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
ApplicationCategoryController.php
backend/controllers/ApplicationCategoryController.php
+9
-4
index.php
backend/views/application-category/index.php
+26
-4
index.js
backend/web/js/application-category/index.js
+2
-1
No files found.
backend/controllers/ApplicationCategoryController.php
View file @
437d3cc1
...
...
@@ -12,6 +12,7 @@ use backend\models\coin\CoinApplicationCategoryForm;
use
common\models\psources\CoinApplicationCategory
;
use
common\models\psources\CoinBanner
;
use
common\models\psources\CoinImage
;
use
common\models\psources\CoinPlatform
;
use
Yii
;
...
...
@@ -24,7 +25,7 @@ class ApplicationCategoryController extends BaseController
public
function
actionIndex
()
{
$user_platform_id
=
Yii
::
$app
->
user
->
identity
->
platform_id
;
$platforms
=
CoinPlatform
::
find
()
->
select
(
'id, name'
)
->
asArray
()
->
all
();
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
...
...
@@ -34,7 +35,13 @@ class ApplicationCategoryController extends BaseController
$where
=
[];
if
(
1
!==
$user_platform_id
)
{
$where
[]
=
[
'platform_id'
=>
$user_platform_id
];
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform'
,
''
);
if
(
!
empty
(
$platform_id
))
{
$where
[]
=
[
'platform_id'
=>
$platform_id
];
}
}
if
(
$name
)
{
$where
[]
=
[
'name'
=>
$name
];
}
...
...
@@ -42,14 +49,12 @@ class ApplicationCategoryController extends BaseController
foreach
(
$data
[
'data'
]
as
&
$val
)
{
$val
[
'name'
]
=
str_replace
(
'en-US'
,
'en'
,
$val
[
'name'
]);
$val
[
'name'
]
=
str_replace
(
'zh-CN'
,
'zh'
,
$val
[
'name'
]);
}
foreach
(
$data
[
'data'
]
as
$key
=>
&
$val
)
{
$val
[
'coin_name'
]
=
isset
(
$val
[
'platform'
][
'name'
])
?
$val
[
'platform'
][
'name'
]
:
''
;
}
return
$data
;
}
return
$this
->
render
(
'index'
);
return
$this
->
render
(
'index'
,
[
'platforms'
=>
$platforms
,
'user_platform_id'
=>
$user_platform_id
]
);
}
/**
...
...
backend/views/application-category/index.php
View file @
437d3cc1
...
...
@@ -23,6 +23,26 @@ IndexAsset::register($this);
<button
class=
"layui-btn layui-btn-default"
id=
"add"
>
添加应用分类
</button>
</a>
</div>
<?php
if
(
1
==
$user_platform_id
)
{
?>
<form
class=
"layui-form"
method=
"get"
action=
""
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
钱包
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"platform"
id =
"platform"
>
<?php
foreach
(
$platforms
as
$key
=>
$platform
)
:
?>
<option
value=
"
<?=
$platform
[
'id'
]
?>
"
>
<?=
$platform
[
'name'
]
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"form1"
>
搜索
</button>
</div>
</form>
<?php
}
?>
</div>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
...
...
@@ -44,13 +64,15 @@ IndexAsset::register($this);
<script
type=
"text/html"
id=
"operationTpl"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"edit"
>
编辑
<
/a>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
href
=
"/admin/application/list?id={{d.id}}"
>
应用列表
<
/a>
<
a
class
=
"layui-btn layui-btn-normal layui-btn-xs"
href
=
"/admin/application-category/banner-index?id={{d.id}}"
>
banner
图管理
<
/a>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
href
=
"/admin/application/list?id={{d.id}}"
>
应用列表
<
/a>
<
a
class
=
"layui-btn layui-btn-normal layui-btn-xs"
href
=
"/admin/application-category/banner-index?id={{d.id}}"
>
banner
图管理
<
/a>
</script>
<script
type=
"text/html"
id=
"recommendTpl"
>
<
input
type
=
"checkbox"
name
=
"isrecommend"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"是|否"
lay
-
filter
=
"recommendDemo"
{{
d
.
isrecommend
==
1
?
'checked'
:
''
}}
>
<
input
type
=
"checkbox"
name
=
"isrecommend"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"是|否"
lay
-
filter
=
"recommendDemo"
{{
d
.
isrecommend
==
1
?
'checked'
:
''
}}
>
</script>
<script
type=
"text/html"
id=
"enableTpl"
>
<
input
type
=
"checkbox"
name
=
"isenable"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"启用|禁用"
lay
-
filter
=
"enableDemo"
{{
d
.
enable
==
1
?
'checked'
:
''
}}
>
<
input
type
=
"checkbox"
name
=
"isenable"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"启用|禁用"
lay
-
filter
=
"enableDemo"
{{
d
.
enable
==
1
?
'checked'
:
''
}}
>
</script>
backend/web/js/application-category/index.js
View file @
437d3cc1
...
...
@@ -13,12 +13,13 @@ var tableIns = table.render({
loading
:
true
,
cols
:
[[
{
field
:
'
coin_
name'
,
title
:
'名称'
,
templet
:
function
(
data
)
{
field
:
'name'
,
title
:
'名称'
,
templet
:
function
(
data
)
{
var
name
=
JSON
.
parse
(
data
.
name
);
console
.
log
(
typeof
(
data
.
name
),
name
.
zh
);
return
name
.
zh
}
},
{
field
:
'coin_name'
,
title
:
'钱包'
},
{
field
:
'icon_url'
,
title
:
'图标'
,
templet
:
'#iconTpl'
},
{
field
:
'isrecommend'
,
title
:
'首页推荐'
,
templet
:
'#recommendTpl'
,
width
:
100
},
{
field
:
'enable'
,
title
:
'状态'
,
templet
:
'#enableTpl'
,
width
:
100
},
...
...
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