o.Raw("UPDATE `auth_user` SET `blog_browes` = (select SUM(browses) browses from blog where user_id = ?) WHERE `id` = ? ",uid,uid).QueryRow(&browses)//获取总条数
o.Raw("UPDATE `auth_user` SET `blog_browes` = (select SUM(browses) browses from blog where user_id = ?) WHERE `id` = ? ",uid,uid).QueryRow(&browses)//获取总条数
return
return
}
}
funcCountComments(uidint64){
funcCountComments(uidint64,bidint64){
o:=orm.NewOrm()
o:=orm.NewOrm()
browses:=0
browses:=0
o.Raw("UPDATE `auth_user` SET `blog_comment` = (select count(id) num from comment where cuser_id = ?) WHERE `id` = ? ",uid,uid).QueryRow(&browses)//获取总条数
o.Raw("UPDATE `auth_user` SET `blog_comment` = (select count(id) num from comment where cuser_id = ?) WHERE `id` = ? ",uid,uid).QueryRow(&browses)//获取总条数
o.Raw("UPDATE `blog` SET `comments` = (select count(id) num from comment where blog_id = ?) WHERE `id` = ? ",bid,bid).QueryRow(&browses)//获取总条数
return
return
}
}
funcCountLike(uidint64){
funcCountLike(uidint64,bidint64){
o:=orm.NewOrm()
o:=orm.NewOrm()
browses:=0
browses:=0
o.Raw("UPDATE `auth_user` SET `blog_like` = (select count(id) num from tb_like where user_id = ?) WHERE `id` = ?",uid,uid).QueryRow(&browses)
o.Raw("UPDATE `auth_user` SET `blog_like` = (select count(id) num from tb_like where user_id = ?) WHERE `id` = ?",uid,uid).QueryRow(&browses)
o.Raw("UPDATE `blog` SET `likes` = (select count(id) num from tb_like where blog_id = ?) WHERE `id` = ?",bid,bid).QueryRow(&browses)