comment not null
This commit is contained in:
parent
1f3c44bbf3
commit
449fc474e7
@ -152,7 +152,9 @@ class Article extends BaseController
|
||||
//获取评论
|
||||
$data = Request::only(['content','article_id','user_id']);
|
||||
$sendId = $data['user_id'];
|
||||
|
||||
if(empty($data['content'])){
|
||||
return json(['code'=>0, 'msg'=>'评论不能为空!']);
|
||||
}
|
||||
//用户留言存入数据库
|
||||
if (Comment::create($data)) {
|
||||
//站内信
|
||||
@ -184,7 +186,6 @@ class Article extends BaseController
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::only(['cate_id','title','title_color','user_id','content','upzip','tags','captcha']);
|
||||
halt($data);
|
||||
$validate = new \app\common\validate\Article; //调用验证器
|
||||
$result = $validate->scene('Artadd')->check($data); //进行数据验证
|
||||
if(true !==$result){
|
||||
|
Loading…
Reference in New Issue
Block a user