sql:="UPDATE `group_power` a left join (SELECT ? `id` FROM group_power WHERE nameplate = ?) b on a.id = b.id SET a.`nameplate`=? where a.id=? and b.id is null;"
iferr:=model.DB().Where("date = ? AND group_power_id = ? AND user_id = ? AND `type` = ?",date.Format("2006-01-02"),groupPowerId,userId,_type).First(res).Error;err!=nil{
db:=model.Db.Model(GroupInfo{}).Where("owner in (select user_id from group_power_user where group_power_id=? order by field(`role`, 2, 3, 1))",familyId)
varcountint64
varcountint64
err:=db.Count(&count).Error
err=model.Db.Model(GroupInfo{}).Select("im_group_id").Where("owner in (select user_id from group_power_user where group_power_id=?)",