mirror of https://github.com/1099438829/apeblog
This commit is contained in:
parent
a767713971
commit
3e4e5911b7
|
|
@ -74,10 +74,11 @@ class Article extends AuthController
|
|||
['link_str',''],
|
||||
['cover_path',''],
|
||||
['display',1],
|
||||
['tag',''],
|
||||
['tags',''],
|
||||
['sort',''],
|
||||
['status',1],
|
||||
]);
|
||||
|
||||
if ($data['title'] == "") return app("json")->fail("文章名称不能为空");
|
||||
if ($data['category_id'] == "") return app("json")->fail("栏目分类不能为空");
|
||||
if ($data['cover_path'] == "") return app("json")->fail("主图不能为空");
|
||||
|
|
@ -87,6 +88,10 @@ class Article extends AuthController
|
|||
$content = $data['content'];
|
||||
unset($data['content']);
|
||||
}
|
||||
if ($data['is_recommend']) $data['is_recommend'] = 1;
|
||||
if ($data['is_hot']) $data['is_hot'] = 1;
|
||||
if ($data['display']) $data['display'] = 1;
|
||||
if ($data['is_top']) $data['is_top'] = 1;
|
||||
if ($id=="")
|
||||
{
|
||||
$data['writer'] = $data['writer']?:$this->adminInfo['nickname'];
|
||||
|
|
@ -96,7 +101,7 @@ class Article extends AuthController
|
|||
'id' => $id,
|
||||
'content' => $content
|
||||
];
|
||||
$res = DocumentArticle::save($updateData);
|
||||
$res = DocumentArticle::insert($updateData);
|
||||
}
|
||||
}else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</ul>
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="home">
|
||||
<form action="#!" method="post" class="row add-form" >
|
||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||
<div class="form-group col-md-12">
|
||||
<label>文章名称</label>
|
||||
<input type="text" class="form-control" id="title" name="title" value="" placeholder="文章名称" />
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="profile">
|
||||
<form action="#!" method="post" class="row add-form">
|
||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||
<div class="form-group row col-md-2">
|
||||
<div class="col-xs-6">推荐</div>
|
||||
<div class="col-xs-6">
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
<div class="col-xs-6">显示</div>
|
||||
<div class="col-xs-6">
|
||||
<label class="lyear-switch switch-solid switch-primary">
|
||||
<input type="checkbox" name="display" checked="">
|
||||
<input type="checkbox" name="display" checked>
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</ul>
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="home">
|
||||
<form action="#!" method="post" class="row add-form" >
|
||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||
<div class="form-group col-md-12">
|
||||
<label>文章名称</label>
|
||||
<input type="text" class="form-control" id="title" name="title" placeholder="文章名称" value="{$info.title}" />
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="profile">
|
||||
<form action="#!" method="post" class="row add-form">
|
||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||
<div class="form-group row col-md-2">
|
||||
<div class="col-xs-6">推荐</div>
|
||||
<div class="col-xs-6">
|
||||
|
|
|
|||
Loading…
Reference in New Issue