类的属性不存在:app\common\model\Comment->ruser_id

浏览:2241 发布日期:2019/03/13 分类:求助交流
添加一条评论,为啥提示类的属性不存在:app\common\model\Comment->ruser_id呢?
控制器方法public function artCom()
    {
        if(Request::isAjax())
        {
            $data=Request::param();
            //halt($data);
            if($data['content']=="")
            {
                return ['status'=>-1,'message'=>'评论内容不能为空'];
            }else{
                $res=Comment::create($data,true);
                if($res)
                {
                    $rname=getUsername($res['ruser_id']);
                    return ['art_id'=>$res['art_id'],'user_id'=>$res['user_id'],'reply_id'=>$res['reply_id'],'rname'=>$rname,'pinglun'=>$res['content'],'shijian'=>$res['create_time'],'rid'=>$res['Id'],'status'=>1,'message'=>'评论发表成功'];
                }
                return ['status'=>0,'message'=>'评论发表失败'];
            }
        } 
    }
前端ajax$("#submit").on('click',function(){
                        var pinglunnr=editor.txt.html();
                        var userId=$(this).attr('user_id');
                        var artId=$(this).attr('art_id');
                        var sessionId=$(this).attr('session_id');
                        $.post("{:url('index/artCom')}",{user_id:sessionId,art_id:artId,content:pinglunnr},function(data){
最佳答案
评论( 相关
后面还有条评论,点击查看>>