|
@@ -8,6 +8,7 @@ import (
|
|
|
"qfw/util"
|
|
|
mogo "qfw/util/mongodb"
|
|
|
"qfw/util/rpc"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
var Rc rpc.RpcCall
|
|
@@ -215,3 +216,19 @@ func UpuserCreditSession(userId, code, dtype string, param map[string]interface{
|
|
|
})
|
|
|
return b
|
|
|
}
|
|
|
+
|
|
|
+//其他更新积分接口--如 翻牌
|
|
|
+func OtherUpuserCredit(userId string, value int, clog map[string]interface{}, xb *xweb.Action) bool {
|
|
|
+ b := mogo.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": &map[string]interface{}{"i_credit": value}}, false, false)
|
|
|
+ if b {
|
|
|
+ //更新session
|
|
|
+ xb.Session().UpdateByCustomField("id", userId, "i_credit", value)
|
|
|
+ //记录日志
|
|
|
+ clog["s_uid"] = userId
|
|
|
+ clog["i_scorenow"] = value
|
|
|
+ clog["l_date"] = time.Now().Unix()
|
|
|
+ clog["l_datenm"] = time.Now().UnixNano() / 1000000
|
|
|
+ mogo.Save("creditlog", clog)
|
|
|
+ }
|
|
|
+ return b
|
|
|
+}
|