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
a2a16aea
Commit
a2a16aea
authored
Nov 06, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美行者BUG
parent
f06a2356
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
application/admin/controller/Project.php
+23
-20
application/admin/view/project/updateproject.html
+1
-1
No files found.
application/admin/controller/Project.php
View file @
a2a16aea
...
...
@@ -52,7 +52,7 @@ class Project extends AuthBase
$project_list
=
$this
->
project_model
->
where
(
$condition
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id desc'
)
->
paginate
(
10
,
false
,
[
'query'
=>
[
'title'
=>
$title
,
'type'
=>
$type
,
'catalog_id'
=>
$catalog_id
]]);
$this
->
assign
(
'project_list'
,
$project_list
);
...
...
@@ -74,20 +74,21 @@ class Project extends AuthBase
$banners
=
[];
//如果是商家则保存客服二维码
if
(
$data
[
'type'
]
==
2
)
{
$result
=
$upload
->
sava
(
$file
[
'kf_qrcode'
]);
if
(
!
$result
[
'error'
])
{
$kf_qrcode
=
$result
[
'result'
][
'url'
];
$file
=
request
()
->
file
(
'kf_qrcode'
);
$info
=
$file
->
move
(
'./upload/qrcode/'
);
if
(
$info
)
{
$kf_qrcode
=
"/upload/qrcode/"
.
$info
->
getSaveName
();
$data
[
'kf_qrcode'
]
=
$kf_qrcode
;
}
}
//保存封面
$result
=
$upload
->
sava
(
$file
[
'poster'
]
);
$result
=
$upload
->
sava
(
input
(
'file.poster'
)
);
if
(
!
$result
[
'error'
])
{
$poster
=
$result
[
'result'
][
'url'
];
$data
[
'poster'
]
=
$poster
;
}
//遍历banner数组并保存
foreach
(
$file
[
'banners'
]
as
$name
=>
$f
)
{
foreach
(
input
(
'file.banners'
)
as
$name
=>
$f
)
{
$result
=
$upload
->
sava
(
$f
);
if
(
!
$result
[
'error'
])
{
$banners
[]
=
$result
[
'result'
][
'url'
];
...
...
@@ -96,8 +97,8 @@ class Project extends AuthBase
}
//去除null
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
===
'null'
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
===
'null'
)
{
unset
(
$data
[
$k
]);
}
}
...
...
@@ -122,6 +123,7 @@ class Project extends AuthBase
}
}
//删除项目、商家
public
function
delete
()
{
...
...
@@ -161,9 +163,9 @@ class Project extends AuthBase
if
(
$data
[
'type'
]
==
2
)
{
if
(
input
(
'file.kf_qrcode'
))
{
$file
=
request
()
->
file
(
'kf_qrcode'
);
$info
=
$file
->
move
(
'./
static
/qrcode/'
);
$info
=
$file
->
move
(
'./
upload
/qrcode/'
);
if
(
$info
)
{
$kf_qrcode
=
"/static/qrcode/"
.
$info
->
getSaveName
();
$kf_qrcode
=
"/upload/qrcode/"
.
$info
->
getSaveName
();
$data
[
'kf_qrcode'
]
=
$kf_qrcode
;
}
}
...
...
@@ -189,8 +191,8 @@ class Project extends AuthBase
}
//去除null
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
===
'null'
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
===
'null'
)
{
unset
(
$data
[
$k
]);
}
}
...
...
@@ -228,7 +230,7 @@ class Project extends AuthBase
public
function
tags
()
{
$title
=
input
(
'get.name'
,
''
);
$tag_list
=
$this
->
tag_model
->
where
(
'name'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
);
$tag_list
=
$this
->
tag_model
->
where
(
'name'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
);
$this
->
assign
(
"tag_list"
,
$tag_list
);
return
$this
->
fetch
(
''
);
}
...
...
@@ -303,7 +305,7 @@ class Project extends AuthBase
public
function
appoint
()
{
$title
=
input
(
'get.name'
,
''
);
$items
=
$this
->
appoint_model
->
where
(
'nickname'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
,
false
,
[
'query'
=>
[
'nickname'
=>
$title
]])
->
each
(
function
(
$item
)
{
$items
=
$this
->
appoint_model
->
where
(
'nickname'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
,
false
,
[
'query'
=>
[
'nickname'
=>
$title
]])
->
each
(
function
(
$item
)
{
$project
=
\app\common\model\Project
::
withTrashed
()
->
find
(
$item
[
'pid'
]);
$item
[
'project_poster'
]
=
$project
[
'poster'
];
$item
[
'project_title'
]
=
$project
[
'title'
];
...
...
@@ -316,7 +318,7 @@ class Project extends AuthBase
public
function
citys
()
{
$title
=
input
(
'get.name'
,
''
);
$tag_list
=
$this
->
city_model
->
where
(
'name'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
);
$tag_list
=
$this
->
city_model
->
where
(
'name'
,
'like'
,
"%"
.
$title
.
"%"
)
->
order
(
'sort'
,
'desc'
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
15
);
$this
->
assign
(
"tag_list"
,
$tag_list
);
return
$this
->
fetch
(
''
);
}
...
...
@@ -520,13 +522,14 @@ class Project extends AuthBase
}
//设置置顶排序
public
function
setHeat
(){
public
function
setHeat
()
{
$heat
=
input
(
'post.heat'
);
$id
=
input
(
'post.id'
);
$res
=
model
(
'project'
)
->
save
([
'heat'
=>
$heat
],[
'id'
=>
$id
]);
if
(
$res
)
{
$res
=
model
(
'project'
)
->
save
([
'heat'
=>
$heat
],
[
'id'
=>
$id
]);
if
(
$res
)
{
$this
->
success
(
'开启成功'
);
}
else
{
}
else
{
$this
->
success
(
'开启失败'
);
}
}
...
...
@@ -535,7 +538,7 @@ class Project extends AuthBase
public
function
setSort
()
{
$project
=
new
\app\common\model\Project
();
$project
->
allowField
(
'id'
,
'sort'
)
->
update
(
input
(
'post.'
));
$project
->
allowField
(
'id'
,
'sort'
)
->
update
(
input
(
'post.'
));
halt
(
$project
->
getLastSql
());
}
}
application/admin/view/project/updateproject.html
View file @
a2a16aea
...
...
@@ -421,7 +421,7 @@ $(function(){
});
}
else
{
showDialog
(
"提示"
,
data
[
'msg'
],
function
()
{
$
(
"#btn-save"
).
removeAttr
(
"disabled"
);
//
$("#btn-save").removeAttr("disabled");
});
}
},
...
...
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