Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
893f3989
Commit
893f3989
authored
Dec 10, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
三级分类
parent
d5a1ca4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
application/admin/controller/Region.php
+13
-0
application/admin/view/public/sidebar.html
+2
-2
application/admin/view/region/index.html
+14
-7
No files found.
application/admin/controller/Region.php
View file @
893f3989
...
...
@@ -61,6 +61,19 @@ class Region extends AuthBase
return
json
([
'code'
=>
1
,
'msg'
=>
'删除失败'
]);
}
public
function
edit
()
{
if
(
request
()
->
isAjax
())
{
$res
=
RegionModel
::
update
(
input
(
'post.'
));
if
(
$res
)
{
return
json
([
'code'
=>
0
,
'msg'
=>
'修改成功'
]);
}
else
{
return
json
([
'code'
=>
1
,
'msg'
=>
$res
->
getError
()
?:
'修改失败'
]);
}
}
return
json
([
'code'
=>
1
,
'msg'
=>
'访问失败'
]);
}
public
function
select
()
{
if
(
input
(
'id'
)
==
0
){
...
...
application/admin/view/public/sidebar.html
View file @
893f3989
...
...
@@ -42,8 +42,8 @@
<li
<?
php
if
(
CONTROLLER_NAME =
=
'
Project
'&&(
ACTION_NAME=
='tags'||ACTION_NAME=='edittag')){echo
'
class=
"active"
';}?
>
>
<a
href=
"<?php echo url("
@
admin
/
Project
/
tags
")?
>
">标签管理
</a>
</li>
<li
<?
php
if
(
CONTROLLER_NAME =
=
'
Project
'&&(
ACTION_NAME=
='citys'||ACTION_NAME=='editcity
')){echo
'
class=
"active"
';}?
>
>
<a
href=
"<?php echo url("
@
admin
/
Project
/
citys
")?
>
">城市管理
</a>
<li
<?
php
if
(
CONTROLLER_NAME =
=
'
Region
'&&(
ACTION_NAME=
='citys'||ACTION_NAME=='index
')){echo
'
class=
"active"
';}?
>
>
<a
href=
"<?php echo url("
@
admin
/
Region
/
index
")?
>
">城市管理
</a>
</li>
</ul>
</li>
...
...
application/admin/view/region/index.html
View file @
893f3989
...
...
@@ -113,7 +113,7 @@
var
arr
=
[
'<input class="form-control" style="margin-right:15px;" type="text" name="title" id="title_'
+
row
.
id
+
'">'
,
'<button type="button" class="RoleOfadd btn-small btn btn-success" style="margin-right:15px;"><i class="fa fa-plus" ></i> 新增</button>'
,
//
'
<
button
type
=
"button"
class
=
"RoleOfedit btn-small btn btn-primary"
style
=
"margin-right:15px;"
><
i
class
=
"fa fa-pencil-square-o"
><
/i> 修改</
button
>
',
'<button type="button" class="RoleOfedit btn-small btn btn-primary" style="margin-right:15px;"><i class="fa fa-pencil-square-o" ></i> 修改</button>'
,
'<button type="button" class="RoleOfdelete btn-small btn btn-danger" style="margin-right:15px;"><i class="fa fa-trash-o" ></i> 删除</button>'
];
if
(
row
.
level
>=
3
)
{
...
...
@@ -147,9 +147,9 @@
'click .RoleOfdelete'
:
function
(
e
,
value
,
row
,
index
)
{
del
(
row
.
id
);
},
//
'
click
.
RoleOfedit
': function (e, value, row, index) {
//
update(row.id);
//
}
'click .RoleOfedit'
:
function
(
e
,
value
,
row
,
index
)
{
update
(
row
.
id
);
}
};
</script>
<script>
...
...
@@ -177,7 +177,14 @@
});
}
// function update(id) {
// alert("update 方法 , id = " + id);
// }
function
update
(
id
)
{
var
title
=
$
(
"#title_"
+
id
).
val
();
$
.
post
(
"{:url('edit')}"
,
{
title
:
title
,
id
:
id
},
function
(
res
)
{
if
(
res
.
code
===
0
)
{
location
.
reload
();
}
else
{
layer
.
msg
(
res
.
msg
,
{
icon
:
2
});
}
});
}
</script>
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