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
d5745a9b
Commit
d5745a9b
authored
Oct 17, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
881be1ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
29 deletions
+40
-29
ApplicateRecommendController.php
backend/controllers/ApplicateRecommendController.php
+24
-1
index.php
backend/views/applicate-recommend/index.php
+15
-1
index.php
backend/views/application-category/index.php
+0
-20
list.php
backend/views/application/list.php
+1
-7
No files found.
backend/controllers/ApplicateRecommendController.php
View file @
d5745a9b
...
...
@@ -78,11 +78,33 @@ class ApplicateRecommendController extends BaseController
{
if
(
Yii
::
$app
->
request
->
isAjax
){
Yii
::
$app
->
response
->
format
=
'json'
;
$data
=
CoinApplicateRecommend
::
find
()
->
asArray
()
->
all
();
$data
=
CoinApplicateRecommend
::
find
()
->
orderBy
(
'sort asc'
)
->
asArray
()
->
all
();
return
[
'data'
=>
$data
,
'code'
=>
0
];
}
return
$this
->
render
(
'index'
);
}
public
function
actionSetSort
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'id'
,
''
);
$type
=
$request
->
get
(
'type'
,
''
);
$sort
=
$request
->
get
(
'sort'
,
1
);
if
(
$id
&&
$type
){
$recommend
=
CoinApplicateRecommend
::
getRecommend
(
$id
,
$type
);
if
(
!
$recommend
){
return
[
'code'
=>
1
,
'msg'
=>
'首页推荐不存在,不能设置排序'
];
}
$recommend
->
sort
=
$sort
;
$recommend
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'首页推荐排序设置成功'
];
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'首页推荐排序设置失败'
];
}
}
}
}
\ No newline at end of file
backend/views/applicate-recommend/index.php
View file @
d5745a9b
...
...
@@ -44,7 +44,8 @@
},
{
field
:
'sort'
,
title
:
'排序'
title
:
'排序'
,
edit
:
'text'
},
{
...
...
@@ -73,7 +74,19 @@
});
}
});
//监听单元格编辑
table
.
on
(
'edit(table1)'
,
function
(
obj
){
var
value
=
obj
.
value
;
//得到修改后的值
var
data
=
obj
.
data
;
//得到所在行所有键值
$
.
get
(
'/admin/applicate-recommend/set-sort'
,
{
id
:
data
.
relate_id
,
type
:
data
.
type
,
sort
:
value
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
table
.
reload
(
'table1'
,{});
}
else
{
}
});
});
</script>
\ No newline at end of file
backend/views/application-category/index.php
View file @
d5745a9b
...
...
@@ -156,27 +156,7 @@
field
:
'isrecommend'
,
templet
:
'#recommendTpl'
,
},
{
field
:
'icon'
,
title
:
'图标'
,
hide
:
true
,
width
:
50
},
{
field
:
'banner_url'
,
title
:
'banner链接'
,
hide
:
true
,
width
:
50
},
{
field
:
'banner_image_url'
,
title
:
'banner图片链接'
,
hide
:
true
,
width
:
50
},
]],
});
...
...
backend/views/application/list.php
View file @
d5745a9b
...
...
@@ -50,6 +50,7 @@
<
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-normal layui-btn-xs"
lay
-
event
=
"add_category"
>
添加所属分类
<
/a>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
lay
-
event
=
"image_info"
>
详情图管理
<
/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'
:
''
}}
>
...
...
@@ -130,13 +131,6 @@
field
:
'isrecommend'
,
templet
:
'#recommendTpl'
,
},
{
field
:
'icon'
,
title
:
'图标'
,
hide
:
true
,
width
:
50
},
]],
});
...
...
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