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
6450d7e1
Commit
6450d7e1
authored
Dec 18, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美行攻略取消标签
parent
1ac59181
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
63 deletions
+2
-63
application/admin/controller/Guide.php
+0
-21
application/admin/view/guide/create.html
+1
-19
application/admin/view/guide/index.html
+0
-4
application/admin/view/guide/update.html
+1
-19
No files found.
application/admin/controller/Guide.php
View file @
6450d7e1
...
@@ -36,17 +36,11 @@ class Guide extends AuthBase
...
@@ -36,17 +36,11 @@ class Guide extends AuthBase
$tag_model
=
model
(
"tags"
);
$tag_model
=
model
(
"tags"
);
//反显数据处理,新建则设为空
//反显数据处理,新建则设为空
$tag_list
=
$tag_model
->
order
(
'sort'
,
'asc'
)
->
select
();
$tag_list
=
$tag_model
->
order
(
'sort'
,
'asc'
)
->
select
();
$this
->
assign
(
'tag_list'
,
$tag_list
);
$this
->
assign
(
'article'
,
0
);
$this
->
assign
(
'article'
,
0
);
$this
->
assign
(
'tag_arr'
,
[]);
$this
->
assign
(
'tags'
,
''
);
if
(
request
()
->
isPost
())
{
if
(
request
()
->
isPost
())
{
$type
=
input
(
"post.type"
);
$type
=
input
(
"post.type"
);
$data
=
array
(
$data
=
array
(
'title'
=>
input
(
"post.title"
),
'title'
=>
input
(
"post.title"
),
'tags'
=>
input
(
"post.tags/a"
),
'poster'
=>
input
(
'file.poster'
)
'poster'
=>
input
(
'file.poster'
)
);
);
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
...
@@ -70,7 +64,6 @@ class Guide extends AuthBase
...
@@ -70,7 +64,6 @@ class Guide extends AuthBase
$article
=
new
PostModel
([
$article
=
new
PostModel
([
'admin_id'
=>
intval
(
session
(
'uid'
)),
'admin_id'
=>
intval
(
session
(
'uid'
)),
'poster'
=>
$result
[
'result'
][
'url'
],
'poster'
=>
$result
[
'result'
][
'url'
],
'tags'
=>
$data
[
'tags'
],
'title'
=>
$data
[
'title'
],
'title'
=>
$data
[
'title'
],
'type'
=>
$type
,
'type'
=>
$type
,
'intro'
=>
input
(
'post.intro'
),
'intro'
=>
input
(
'post.intro'
),
...
@@ -94,24 +87,11 @@ class Guide extends AuthBase
...
@@ -94,24 +87,11 @@ class Guide extends AuthBase
public
function
update
(
$id
)
public
function
update
(
$id
)
{
{
//反显数据处理
//反显数据处理
$tag_model
=
model
(
"tags"
);
$tag_list
=
$tag_model
->
order
(
'sort'
,
'asc'
)
->
select
();
$this
->
assign
(
'tag_list'
,
$tag_list
);
$article
=
PostModel
::
get
(
$id
);
$article
=
PostModel
::
get
(
$id
);
$tags
=
$article
[
'tags'
];
$this
->
assign
(
'tags'
,
$tags
);
if
(
$tags
!=
''
)
{
$tag_arr
=
explode
(
','
,
$tags
);
}
else
{
$tag_arr
=
[];
}
$this
->
assign
(
'tag_arr'
,
$tag_arr
);
if
(
request
()
->
isPost
())
{
if
(
request
()
->
isPost
())
{
$type
=
input
(
"post.type"
);
$type
=
input
(
"post.type"
);
$data
=
array
(
$data
=
array
(
'title'
=>
input
(
"post.title"
),
'title'
=>
input
(
"post.title"
),
'tags'
=>
input
(
"post.tags/a"
)
);
);
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$data
[
'content'
]
=
input
(
"post.content"
);
$data
[
'content'
]
=
input
(
"post.content"
);
...
@@ -125,7 +105,6 @@ class Guide extends AuthBase
...
@@ -125,7 +105,6 @@ class Guide extends AuthBase
return
view
();
return
view
();
}
}
$condition
=
[
$condition
=
[
'tags'
=>
implode
(
','
,
$data
[
'tags'
]),
'title'
=>
$data
[
'title'
],
'title'
=>
$data
[
'title'
],
'intro'
=>
input
(
'post.intro'
),
'intro'
=>
input
(
'post.intro'
),
'type'
=>
$type
,
'type'
=>
$type
,
...
...
application/admin/view/guide/create.html
View file @
6450d7e1
...
@@ -52,17 +52,6 @@
...
@@ -52,17 +52,6 @@
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略标签
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"hidden"
name=
"tags"
id=
"tags"
value=
""
>
<select
class=
"selectpicker form-control"
id=
"tags_select"
multiple
data-live-search=
"true"
onchange=
"setTags()"
>
{volist name="tag_list" name="tag_list" id="vo"}
<option
value=
"{$vo.id}"
>
{$vo.name}
</option>
{/volist}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略类型
</label>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略类型
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
class=
"form-control"
name=
"type"
id=
"post_type"
>
<select
class=
"form-control"
name=
"type"
id=
"post_type"
>
...
@@ -140,14 +129,7 @@ $("#input-b1").fileinput({
...
@@ -140,14 +129,7 @@ $("#input-b1").fileinput({
showUpload
:
false
,
//是否显示上传按钮
showUpload
:
false
,
//是否显示上传按钮
allowedFileExtensions
:
[
'bmp'
,
'jpg'
,
'png'
,
'tif'
,
'gif'
,
'pcx'
,
'tga'
,
'exif'
,
'fpx'
,
'svg'
,
'cdr'
,
'pcd'
,
'dxf'
,
'ufo'
,
'eps'
,
'raw'
,
'WMF'
,
'webp'
],
//接收的文件后缀
allowedFileExtensions
:
[
'bmp'
,
'jpg'
,
'png'
,
'tif'
,
'gif'
,
'pcx'
,
'tga'
,
'exif'
,
'fpx'
,
'svg'
,
'cdr'
,
'pcd'
,
'dxf'
,
'ufo'
,
'eps'
,
'raw'
,
'WMF'
,
'webp'
],
//接收的文件后缀
})
})
function
setTags
(){
var
slected
=
$
(
"#tags_select"
).
val
();
if
(
slected
){
$
(
"#tags"
).
val
(
slected
.
toString
());
}
else
{
$
(
"#tags"
).
val
(
""
);
}
}
UE
.
getEditor
(
'post_container'
,
{
UE
.
getEditor
(
'post_container'
,
{
//编辑区域大小
//编辑区域大小
'initialFrameHeight'
:
'350'
,
'initialFrameHeight'
:
'350'
,
...
...
application/admin/view/guide/index.html
View file @
6450d7e1
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
<th>
攻略标题
</th>
<th>
攻略标题
</th>
<th>
类型
</th>
<th>
类型
</th>
<th>
简介
</th>
<th>
简介
</th>
<th>
标签
</th>
<th>
封面
</th>
<th>
封面
</th>
<th>
排序
</th>
<th>
排序
</th>
<th>
发布时间
</th>
<th>
发布时间
</th>
...
@@ -63,9 +62,6 @@
...
@@ -63,9 +62,6 @@
</td>
</td>
<td>
<?=$article->type=='1'?'自建文章':'网络文章';?>
</td>
<td>
<?=$article->type=='1'?'自建文章':'网络文章';?>
</td>
<td
style=
"max-width:200px;"
>
<?=$article->intro;?>
</td>
<td
style=
"max-width:200px;"
>
<?=$article->intro;?>
</td>
<td
style=
"max-width: 200px"
>
{volist name="$article.tags" id="tag" key="k"}{if condition="$k!=1"}/{/if}{$tag}{/volist}
</td>
<td>
<td>
<a
href=
"<?=$article->poster?>"
target=
"_blank"
data-fancybox=
"images"
>
<a
href=
"<?=$article->poster?>"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"<?=$article->poster?>"
width=
'100'
>
<img
src=
"<?=$article->poster?>"
width=
'100'
>
...
...
application/admin/view/guide/update.html
View file @
6450d7e1
...
@@ -61,17 +61,6 @@
...
@@ -61,17 +61,6 @@
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略标签
</label>
<div
class=
"col-sm-20 col-md-8 col-lg-6"
>
<!--<input type="hidden" name="tags[]" id="tags" value="{$tags}">-->
<select
class=
"selectpicker form-control"
name=
"tags[]"
multiple
data-live-search=
"true"
>
{volist name="tag_list" name="tag_list" id="vo"}
<option
{
if
condition=
"in_array($vo.id,$tag_arr)"
}
selected
{/
if
}
value=
"{$vo.id}"
>
{$vo.name}
</option>
{/volist}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略类型
</label>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略类型
</label>
<div
class=
"col-sm-20 col-md-8 col-lg-6"
>
<div
class=
"col-sm-20 col-md-8 col-lg-6"
>
<select
class=
"form-control"
name=
"type"
id=
"post_type"
>
<select
class=
"form-control"
name=
"type"
id=
"post_type"
>
...
@@ -170,14 +159,7 @@ $("#input-b1").change(function(data){
...
@@ -170,14 +159,7 @@ $("#input-b1").change(function(data){
$
(
"#input-b1"
).
on
(
"fileclear"
,
function
(
event
,
data
,
msg
){
$
(
"#input-b1"
).
on
(
"fileclear"
,
function
(
event
,
data
,
msg
){
$
(
"#poster_view"
).
show
();
$
(
"#poster_view"
).
show
();
});
});
function
setTags
(){
var
slected
=
$
(
"#tags_select"
).
val
();
if
(
slected
){
$
(
"#tags"
).
val
(
slected
.
toString
());
}
else
{
$
(
"#tags"
).
val
(
""
);
}
}
UE
.
getEditor
(
'post_container'
,
{
UE
.
getEditor
(
'post_container'
,
{
//编辑区域大小
//编辑区域大小
'initialFrameHeight'
:
'350'
,
'initialFrameHeight'
:
'350'
,
...
...
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