|
@@ -128,12 +128,20 @@ func (r *Recommend) getList(tidb *Mysql, userId string, limit int) (*[]map[strin
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-func (r *Recommend) SaveLog(mgo *MongodbSim, userId string, autoId int64, hasPhone, isNewestBid int) string {
|
|
|
- return mgo.Save("subrecommend_log", map[string]interface{}{
|
|
|
+func (r *Recommend) SaveLog(mgo *MongodbSim, userId string, autoId int64, t string, hasPhone, isNewestBid bool) string {
|
|
|
+ m := map[string]interface{}{
|
|
|
"userid": userId,
|
|
|
"autoid": autoId,
|
|
|
- "hasphone": hasPhone,
|
|
|
- "isnewestbid": isNewestBid,
|
|
|
+ "type": t,
|
|
|
+ "hasphone": 0,
|
|
|
+ "isnewestbid": 0,
|
|
|
"create_time": time.Now().Unix(),
|
|
|
- })
|
|
|
+ }
|
|
|
+ if hasPhone {
|
|
|
+ m["hasphone"] = 1
|
|
|
+ }
|
|
|
+ if isNewestBid {
|
|
|
+ m["isnewestbid"] = 1
|
|
|
+ }
|
|
|
+ return mgo.Save("subrecommend_log", m)
|
|
|
}
|