Browse Source

积分变量调整

张金坤 9 years ago
parent
commit
af17160f60

+ 7 - 7
common/src/qfw/util/credit/credit.go

@@ -67,7 +67,7 @@ func init() {
 }
 
 //一次性任务积分
-func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
+func InCreditA(userId, code string, credit_a int64) (bool, int64, int, error) {
 	result := false
 	if len(userId) < 1 {
 		return result, credit_a, 0, nil
@@ -87,7 +87,7 @@ func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
 }
 
 //剑鱼一次性任务
-func CheckSword(userId, code string, credit_a int, xb *xweb.Action) bool {
+func CheckSword(userId, code string, credit_a int64, xb *xweb.Action) bool {
 	result := false
 	if !AIsHasDo(code, credit_a) {
 		result, credit_a = UpuserCreditA(code, userId, credit_a)
@@ -116,18 +116,18 @@ func InCreditB(userId, code string, param map[string]interface{}) (bool, int, er
 }
 
 //更新用户一次性积分状态
-func UpuserCreditA(code, userId string, credit_a int) (bool, int) {
+func UpuserCreditA(code, userId string, credit_a int64) (bool, int64) {
 	var ret uint64
 	if tmp, ok := CreditA[code]; ok {
 		ret = 1 << (tmp - 1)
 	}
 	n_credit_a := uint64(credit_a) + ret
 	b := mogo.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": &map[string]interface{}{"credit_a": int64(n_credit_a)}}, true, false)
-	return b, int(n_credit_a)
+	return b, int64(n_credit_a)
 }
 
 //判断一次性积分是否完成
-func AIsHasDo(code string, num int) bool {
+func AIsHasDo(code string, num int64) bool {
 	b := false
 	var ret uint64
 	if tmp, ok := CreditA[code]; ok {
@@ -140,7 +140,7 @@ func AIsHasDo(code string, num int) bool {
 }
 
 //判断A是否完成
-func AAllIsHasDo(num int) bool {
+func AAllIsHasDo(num int64) bool {
 	b := false
 	var ret uint64
 	for k, v := range CreditA {
@@ -187,7 +187,7 @@ func UpuserCreditSession(userId, code, dtype string, param map[string]interface{
 	score := 0
 	util.Try(func() {
 		if dtype == "A" {
-			credit_a := util.IntAll(xb.GetSession("credit_a"))
+			credit_a := util.Int64All(xb.GetSession("credit_a"))
 			b, credit_a, score, _ = InCreditA(userId, code, credit_a)
 			if b {
 				xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)

+ 1 - 1
core/src/qfw/manage/auditing.go

@@ -792,7 +792,7 @@ func (s *SystemManage) Updateaudit() error {
 		}
 		//认证送积分
 		if flag == "true" && _status == 1 {
-			b, credit_a, score, _ := credit.InCreditA(s_submitid, credit.A_RZ, util.IntAll((*f)["credit_a"]))
+			b, credit_a, score, _ := credit.InCreditA(s_submitid, credit.A_RZ, util.Int64All((*f)["credit_a"]))
 			if b {
 				s.Session().UpdateByCustomField("id", s_submitid, "i_credit", util.IntAll((*f)["i_credit"])+score)
 				s.Session().UpdateByCustomField("id", s_submitid, "credit_a", credit_a)

+ 3 - 3
core/src/qfw/member/bidmanage.go

@@ -206,7 +206,7 @@ func (d *BidManage) ChangeStatus() error {
 			if status == 3 {
 				param := make(map[string]interface{})
 				param["objid"] = wtb["s_userid"].(string)
-				credit_a := util.IntAll(d.GetSession("credit_a"))
+				credit_a := util.Int64All(d.GetSession("credit_a"))
 				//log.Println("选标", credit.AIsHasDo(credit.A_WCJY, credit_a), userId, param["objid"])
 				if credit.AIsHasDo(credit.A_WCJY, credit_a) {
 					credit.UpuserCreditSession(userId, credit.C_JY, "B", param, d.Action)
@@ -216,8 +216,8 @@ func (d *BidManage) ChangeStatus() error {
 				}
 				//判断对方是否完成一次性任务
 				rr := *FindById("user", param["objid"].(string), nil)
-				if !credit.AIsHasDo(credit.A_WCJY, util.IntAll(rr["credit_a"])) {
-					b, credit_a, score, _ := credit.InCreditA(param["objid"].(string), credit.A_WCJY, util.IntAll(rr["credit_a"]))
+				if !credit.AIsHasDo(credit.A_WCJY, util.Int64All(rr["credit_a"])) {
+					b, credit_a, score, _ := credit.InCreditA(param["objid"].(string), credit.A_WCJY, util.Int64All(rr["credit_a"]))
 					if b {
 						d.Session().UpdateByCustomField("id", param["objid"].(string), "credit_a", credit_a)
 						d.Session().UpdateByCustomField("id", param["objid"].(string), "i_credit", util.IntAll(rr["i_credit"])+score)

+ 2 - 2
core/src/qfw/member/credit/creditdetail.go

@@ -33,7 +33,7 @@ func (c *credit) MyCredit() error {
 	if len(userId) > 0 {
 		user := *mongodb.FindById("user", userId, nil)
 		c.T["user"] = user
-		credit_a := util.IntAll(user["credit_a"])
+		credit_a := util.Int64All(user["credit_a"])
 		b := cd.AAllIsHasDo(credit_a)
 		u := c.Header("User-Agent")
 		if strings.Index(u, "Mobile") > -1 {
@@ -104,7 +104,7 @@ func (c *credit) InCreditAjx() error {
 	result := make(M)
 	result["result"] = "n"
 	if len(userId) > 0 {
-		credit_a := util.IntAll(c.GetSession("credit_a"))
+		credit_a := util.Int64All(c.GetSession("credit_a"))
 		param := c.GetString("param")
 		//分享服务
 		if param == "fx" {

+ 4 - 4
core/src/qfw/member/membermanager.go

@@ -878,7 +878,7 @@ func (m *Member) Bindmail() error {
 				bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
 				if bol {
 					//绑邮箱送积分
-					if !credit.AIsHasDo(credit.A_BYX, IntAll(m.GetSession("credit_a"))) {
+					if !credit.AIsHasDo(credit.A_BYX, Int64All(m.GetSession("credit_a"))) {
 						credit.UpuserCreditSession(usid, credit.A_BYX, "A", nil, m.Action)
 					}
 					//邮箱绑定认证
@@ -888,7 +888,7 @@ func (m *Member) Bindmail() error {
 						if len(r) > 0 && ac == "" {
 							autoAuth(usid, uname, avatar, entid, proid)
 							//认证送积分
-							credit.InCreditA(usid, credit.A_RZ, IntAll(m.GetSession("credit_a")))
+							credit.InCreditA(usid, credit.A_RZ, Int64All(m.GetSession("credit_a")))
 							//发系统消息
 							msg := &msg.Msg{
 								Msgtype:   1,
@@ -966,7 +966,7 @@ func (m *Member) Bindphone() error {
 				bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
 				if bol {
 					//绑手机送积分
-					if !credit.AIsHasDo(credit.A_BSJ, IntAll(m.GetSession("credit_a"))) {
+					if !credit.AIsHasDo(credit.A_BSJ, Int64All(m.GetSession("credit_a"))) {
 						credit.UpuserCreditSession(m.GetSession("userId").(string), credit.A_BSJ, "A", nil, m.Action)
 					}
 					UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
@@ -1131,7 +1131,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
 		setSessMap["identType"] = IntAll(r["i_identificationtype"])
 		setSessMap["identWay"] = IntAll(r["i_identificationway"])
 		setSessMap["opLocDistrict"] = r["opLocDistrict"]
-		setSessMap["credit_a"] = IntAll(r["credit_a"])
+		setSessMap["credit_a"] = Int64All(r["credit_a"])
 		setSessMap["i_credit"] = IntAll(r["i_credit"])
 		if r["s_phone"] == nil || r["s_phone"].(string) == "" {
 			setSessMap["phone"] = ""

+ 3 - 3
core/src/qfw/member/ordermanage.go

@@ -76,7 +76,7 @@ func (o *OrderManage) ChangeStatus() error {
 		if flag && status == 3 {
 			param := make(map[string]interface{})
 			param["objid"] = (*r)["s_editorid"]
-			credit_a := util.IntAll(o.GetSession("credit_a"))
+			credit_a := util.Int64All(o.GetSession("credit_a"))
 			userId := util.ObjToString(o.GetSession("userId"))
 			//log.Println("预约", credit.AIsHasDo(credit.A_WCJY, credit_a), userId, param["objid"])
 			if credit.AIsHasDo(credit.A_WCJY, credit_a) {
@@ -87,8 +87,8 @@ func (o *OrderManage) ChangeStatus() error {
 			}
 			//判断对方是否完成一次性任务
 			rr := *FindById("user", param["objid"].(string), nil)
-			if !credit.AIsHasDo(credit.A_WCJY, util.IntAll(rr["credit_a"])) {
-				b, credit_a, score, _ := credit.InCreditA(param["objid"].(string), credit.A_WCJY, util.IntAll(rr["credit_a"]))
+			if !credit.AIsHasDo(credit.A_WCJY, util.Int64All(rr["credit_a"])) {
+				b, credit_a, score, _ := credit.InCreditA(param["objid"].(string), credit.A_WCJY, util.Int64All(rr["credit_a"]))
 				if b {
 					o.Session().UpdateByCustomField("id", param["objid"].(string), "credit_a", credit_a)
 					o.Session().UpdateByCustomField("id", param["objid"].(string), "i_credit", util.IntAll(rr["i_credit"])+score)

+ 2 - 2
core/src/qfw/member/yellowpage.go

@@ -237,7 +237,7 @@ func (yp *Yellowpage) Dosave() error {
 		status = "n"
 		info = "保存信息失败"
 	} else { //首次创建企业名片,送积分
-		if !credit.AIsHasDo(credit.A_CJMP, util.IntAll(yp.GetSession("credit_a"))) {
+		if !credit.AIsHasDo(credit.A_CJMP, util.Int64All(yp.GetSession("credit_a"))) {
 			credit.UpuserCreditSession(util.ObjToString(yp.GetSession("userId")), credit.A_CJMP, "A", nil, yp.Action)
 		}
 	}
@@ -435,7 +435,7 @@ func (yp *Yellowpage) AddService() error {
 		tempFlag = len(_id) > 0
 		//发服务送积分
 		if tempFlag {
-			if credit.AIsHasDo(credit.A_FFW, util.IntAll(yp.GetSession("credit_a"))) {
+			if credit.AIsHasDo(credit.A_FFW, util.Int64All(yp.GetSession("credit_a"))) {
 				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.B_FFW, "B", nil, yp.Action)
 			} else {
 				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.A_FFW, "A", nil, yp.Action)

+ 4 - 4
core/src/qfw/mobile/wxmenu.go

@@ -207,7 +207,7 @@ func (m *Mobile) SwordfishPay() error {
 						}
 						//i_credit -= len(isPay) * 1000
 						if i_credit >= 0 {
-							credit_a := util.IntAll(m.GetSession("credit_a"))
+							credit_a := util.Int64All(m.GetSession("credit_a"))
 							b := false
 							if b, _ = credit.OutCreditB(userId.(string), strings.Join(mapCode, ","), util.ObjToString(m.GetSession("s_m_openid")), 0, isPay, m.Action); b {
 								//先扣分,然后更新,然后返回结果
@@ -324,10 +324,10 @@ func (m *Mobile) AjaxReq() error {
 			}
 			//更新数据库
 			msgset["l_modifydate"] = time.Now().Unix()
-			
+
 			if mongodb.Update("user", `{"_id":"`+userId.(string)+`"}`, &map[string]interface{}{"$set": set}, false, false) {
 				flag = "y"
-			/**
+				/**
 				credit_a := util.Int64All(m.GetSession("credit_a"))
 				if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) && len(mapPush) > 0 {
 					util.Try(func() {
@@ -350,7 +350,7 @@ func (m *Mobile) AjaxReq() error {
 				}
 				**/
 			}
-			
+
 		}
 		break
 	}

+ 1 - 1
core/src/qfw/search/searchService.go

@@ -164,7 +164,7 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 		if len(queryStr) > 0 {
 			userId := ObjToString(n.GetSession("userId"))
 			if len(userId) > 0 {
-				credit_a := IntAll(n.GetSession("credit_a"))
+				credit_a := Int64All(n.GetSession("credit_a"))
 				if credit.AIsHasDo(credit.A_QYCX, credit_a) {
 					credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
 				} else {

+ 1 - 1
core/src/qfw/searchmarket/demand.go

@@ -176,7 +176,7 @@ func (d *Demand) AddDemand() error {
 			b := UpdateNewDoc("demand", "demand", mongo.FindById("demand", rs, ""))
 			//发布需求送积分
 			if b {
-				credit_a := util.IntAll(d.GetSession("credit_a"))
+				credit_a := util.Int64All(d.GetSession("credit_a"))
 				if credit.AIsHasDo(credit.A_FXQ, credit_a) {
 					credit.UpuserCreditSession(util.ObjToString(s_userid), credit.B_FXQ, "B", nil, d.Action)
 				} else {

+ 1 - 1
core/src/qfw/searchmarket/service.go

@@ -281,7 +281,7 @@ func (s *Service) Comment() error {
 						//评价送积分
 						param := make(map[string]interface{})
 						param["serviceid"] = s_serviceid
-						credit_a := util.IntAll(s.GetSession("credit_a"))
+						credit_a := util.Int64All(s.GetSession("credit_a"))
 						if credit.AIsHasDo(credit.A_WCJYPJ, credit_a) {
 							credit.UpuserCreditSession(s_userid, credit.C_PJ, "B", param, s.Action)
 						} else {

+ 1 - 1
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -453,7 +453,7 @@ func (yp *Yellowpage) GetRelation() error {
 		entName := yp.GetString("entName")
 		if regNo != "" && entName != "" {
 			relation, flag = getRelation(regNo, entName)
-			if flag && !credit.AIsHasDo(credit.A_CKGXW, util.IntAll(yp.GetSession("credit_a"))) {
+			if flag && !credit.AIsHasDo(credit.A_CKGXW, util.Int64All(yp.GetSession("credit_a"))) {
 				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.A_CKGXW, "A", nil, yp.Action)
 			}
 		}