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
91cc8b16
Commit
91cc8b16
authored
Nov 16, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动商家
parent
96ad8405
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
13 deletions
+24
-13
application/admin/controller/Project.php
+6
-2
application/admin/view/project/index.html
+7
-2
application/admin/view/project/updateproject.html
+11
-9
No files found.
application/admin/controller/Project.php
View file @
91cc8b16
...
...
@@ -47,13 +47,17 @@ class Project extends AuthBase
if
(
$catalog_id
)
{
$condition
[
'catalog_id'
]
=
$catalog_id
;
}
if
(
input
(
'order'
)
==
2
){
$order
=
[
'sort'
=>
'desc'
,
'id'
=>
'desc'
];
}
else
{
$order
=
[
'id'
=>
'desc'
];
}
$catalog_list
=
$this
->
catalog_model
->
order
(
'sort'
,
'asc'
)
->
select
();
$this
->
assign
(
'catalog_list'
,
$catalog_list
);
$project_list
=
$this
->
project_model
->
where
(
$condition
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id desc'
)
->
order
(
$order
)
->
paginate
(
10
,
false
,
[
'query'
=>
[
'title'
=>
$title
,
'type'
=>
$type
,
'catalog_id'
=>
$catalog_id
]]);
$this
->
assign
(
'project_list'
,
$project_list
);
return
$this
->
fetch
(
''
);
...
...
application/admin/view/project/index.html
View file @
91cc8b16
...
...
@@ -33,7 +33,12 @@
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<form
class=
"form-inline pull-left"
method=
"GET"
action=
"{:url('admin/project/index')}"
>
<div
class=
"form-group margin-right"
>
<select
name=
"order"
class=
"form-control"
>
<option
value=
"1"
>
最新(排序)
</option>
<option
value=
"2"
>
火爆(排序)
</option>
</select>
</div>
<div
class=
"form-group margin-right"
>
<select
name=
"catalog_id"
class=
"form-control"
>
<option
value=
""
>
所有分类
</option>
...
...
@@ -144,7 +149,7 @@
<input
type=
"number"
size=
"4"
style=
"width:50px"
onchange=
"setSort(this.value,{$vo.id})"
value=
"{$vo.sort}"
>
</td>
<td>
<a
href=
"{:url('admin/project/updateProject',['id'=>$vo.id])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"{:url('admin/project/updateProject',['id'=>$vo.id
,'page'=>input('page')
])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"javascript:"
oid=
"{$vo.id}"
class=
"btn btn-xs btn-danger btn-delete"
><i
class=
"fa fa-trash"
></i></a>
</td>
</tr>
...
...
application/admin/view/project/updateproject.html
View file @
91cc8b16
...
...
@@ -3,6 +3,7 @@
<link
rel=
"stylesheet"
href=
"/static/fileinput/css/fileinput.css"
>
<link
rel=
"stylesheet"
href=
"/static/bootstrap-select/css/bootstrap-select.min.css"
>
<link
rel=
"stylesheet"
href=
"/static/datetimepicker/css/bootstrap-datetimepicker.min.css"
>
<script
src=
"/static/layer/layer.js"
></script>
<style
type=
"text/css"
>
...
...
@@ -330,7 +331,7 @@ $(function(){
});
//表单AJAX提交 ,使用formData
$
(
"#btn-save"
).
click
(
function
(){
$
(
this
).
attr
(
"disabled"
,
"true"
);
//
$(this).attr("disabled","true");
var
validate
=
$
(
'#myFrom'
).
validationEngine
(
'validate'
)
if
(
!
validate
){
$
(
this
).
removeAttr
(
"disabled"
);
...
...
@@ -407,7 +408,7 @@ $(function(){
formValue
.
append
(
'kf_qrcode'
,
qcode
[
0
]);
}
}
var
index
=
layer
.
load
(
2
,{
shade
:
[
0.6
,
'#fff'
]
});
$
.
ajax
({
url
:
saveUrl
,
type
:
"POST"
,
...
...
@@ -415,18 +416,19 @@ $(function(){
processData
:
false
,
// 不处理数据
contentType
:
false
,
// 不设置内容类型
success
:
function
(
data
){
layer
.
close
(
index
);
if
(
data
[
'code'
]
==
1
)
{
showDialog
(
"提示"
,
data
[
'msg'
],
function
()
{
window
.
location
.
href
=
"{:url('admin/project/index')}"
;
});
layer
.
msg
(
data
[
'msg'
],{
icon
:
1
});
setTimeout
(
function
(){
window
.
location
.
href
=
"{:url('admin/project/index',['page'=>input('page')])}"
;
},
1500
);
}
else
{
showDialog
(
"提示"
,
data
[
'msg'
],
function
()
{
// $("#btn-save").removeAttr("disabled");
});
layer
.
msg
(
data
[
'msg'
],{
icon
:
2
});
}
},
error
:
function
(
err
){
$
(
"#btn-save"
).
removeAttr
(
"disabled"
);
layer
.
close
(
index
);
$
(
"#btn-save"
).
removeAttr
(
"disabled"
);
console
.
log
(
err
);
}
});
...
...
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