浏览代码

记积分

zhanghongbo 9 年之前
父节点
当前提交
d52dca9dad
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 2 7
      weixin/src/qfw/weixin/dao/userdao.go

+ 2 - 7
weixin/src/qfw/weixin/dao/userdao.go

@@ -40,13 +40,8 @@ func AddUser(openid, unionid, bindweixin, userphoto string) (err error, flag int
 		}
 		data["i_identificationway"] = 0
 		data["s_m_openid"] = openid //微信手机端openid
-		if len(Save("user", data)) > 0 {
-			//注册送积分
-			m := FindOne("user", `{"s_m_openid":"`+openid+`"}`)
-			if m != nil {
-				id := fmt.Sprintf("%x", string((*m)["_id"].(ObjectId)))
-				credit.InCreditA(id, credit.A_ZC, 0)
-			}
+		if id := Save("user", data); len(id) > 0 {
+			go credit.InCreditA(id, credit.A_ZC, 0)
 			return nil, 1
 		} else {
 			return errors.New("保存用户失败"), 0