diamondAccount.SetCheckUpdateCondition(" EXISTS (SELECT * from (SELECT COUNT(1) as n from diamond_account_detail d where d.user_id = "+strconv.FormatUint(diamondAccount.UserId,10)+" and d.operate_type = "+strconv.FormatUint(uint64(operateType),10)+" and d.created_time >= from_unixtime("+strconv.FormatInt(getZeroTime(time.Now()).Unix(),10)+")) t where t.n < "+strconv.Itoa(diamondOperateSet.FrequencyNum)+" )")
sql:="select s1.* from (select * from user_info where user_type=? and status=0 and diamond=0 limit 50) s1 left join group_info on s1.tx_group_id=group_info.tx_group_id where group_info.password='' and group_info.tourist_mic=1"
err=model.Db.Raw(sql,userType).Find(&infos).Error
//err = model.Db.Where("status = 0 and user_type = ?", userType).Limit(10).Find(&infos).Error
err:=db.Where("id in (select user_id from user_player where user_id=? and end_at=0) and tx_group_id = ? and status in (0,1)",userId,txGroupId).First(&res).Error
//err := db.Where("status in (0,1)").First(&res).Error
sql:="SELECT user.id as user_uid,user.user_type,user.tx_group_id as group_id,mg_id,user.diamond,user.`status`,user.updated_time FROM user_info user,group_info g "+
"WHERE user.tx_group_id = g.tx_group_id AND user. STATUS = 0 AND user.auto_match = 1 AND user.battle_start_at = 0 AND g.`password` = '' AND g.tourist_mic = 1"