|
@@ -300,19 +300,19 @@ func LabelAction(labInfo *LabelInfo, userid string) map[string]interface{} {
|
|
labInfo.Binfo = FormatColl(labInfo.Binfo)
|
|
labInfo.Binfo = FormatColl(labInfo.Binfo)
|
|
for _, bd := range labInfo.Binfo {
|
|
for _, bd := range labInfo.Binfo {
|
|
now := time.Now().Unix()
|
|
now := time.Now().Unix()
|
|
- if collCount >= maxCount {
|
|
|
|
- ok, msg = false, qu.If(isPay, "付费用户收藏已达上限", "免费用户收藏已达上限").(string)
|
|
|
|
- log.Printf("userid :%s,收藏失败 id : %s ,已收藏数量:%v ,上限数量:%v", userid, util.DecodeId(bd.Bid), collCount, maxCount)
|
|
|
|
|
|
+ if collMap[util.DecodeId(bd.Bid)] {
|
|
|
|
+ //更新
|
|
|
|
+ if updatesql == fmt.Sprintf("update %s set labelid=? where userid = ? and ", db.DbConf.Bdcollection) {
|
|
|
|
+ updatesql += `( bid =? `
|
|
|
|
+ } else {
|
|
|
|
+ updatesql += `or bid =? `
|
|
|
|
+ }
|
|
|
|
+ updateValue = append(updateValue, util.DecodeId(bd.Bid))
|
|
|
|
+ i++
|
|
} else {
|
|
} else {
|
|
- if collMap[util.DecodeId(bd.Bid)] {
|
|
|
|
- //更新
|
|
|
|
- if updatesql == fmt.Sprintf("update %s set labelid=? where userid = ? and ", db.DbConf.Bdcollection) {
|
|
|
|
- updatesql += `( bid =? `
|
|
|
|
- } else {
|
|
|
|
- updatesql += `or bid =? `
|
|
|
|
- }
|
|
|
|
- updateValue = append(updateValue, util.DecodeId(bd.Bid))
|
|
|
|
- i++
|
|
|
|
|
|
+ if collCount >= maxCount {
|
|
|
|
+ ok, msg = false, qu.If(isPay, "付费用户收藏已达上限", "免费用户收藏已达上限").(string)
|
|
|
|
+ log.Printf("userid :%s,收藏失败 id : %s ,已收藏数量:%v ,上限数量:%v", userid, util.DecodeId(bd.Bid), collCount, maxCount)
|
|
} else {
|
|
} else {
|
|
i++
|
|
i++
|
|
//新增并绑定标签 "userid", "bid", "labelid", "buyerclass", "buyerinfo", "winnerinfo", "createdate"
|
|
//新增并绑定标签 "userid", "bid", "labelid", "buyerclass", "buyerinfo", "winnerinfo", "createdate"
|