$param['uid'],'chapter'=>$param['chapter']]; $update = ['tags'=>$param['tags'],'bid'=>$param['bid']]; return self::updateOrCreate($sign,$update); } public static function getChapterComment($cid,$uid){ return self::where([ ['chapter','=',$cid],['uid','=',$uid] ])->first(); } public static function getBookStats(){ self::select(DB::raw('sum(uv) as UV,count(')) ->leftjoin('book_configs','book_configs.bid','=','chapter_comments.bid') ->groupBy('chapter_comments.bid') ->get(); } }