Browse Source

fix:订阅修改调整

fuwencai 2 năm trước cách đây
mục cha
commit
5cd46546e7
1 tập tin đã thay đổi với 13 bổ sung15 xóa
  1. 13 15
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go

+ 13 - 15
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -596,27 +596,25 @@ func (this *vipSubscribeStruct) CanTrial(userId string, session *httpsession.Ses
 
 // 订阅修改
 func (this *vipSubscribeStruct) SubChange(userId string, oldVip, areaNew *map[string]interface{}, industryNew []string, session *httpsession.Session) bool {
-	updateOk := false
-	util.Compatible.Update(userId, bson.M{"$set": bson.M{
+	updateOk := util.Compatible.Update(userId, bson.M{"$set": bson.M{
 		"o_vipjy.o_area":       areaNew,     //设置地区
 		"o_vipjy.a_buyerclass": industryNew, //设置行业
 	}})
 	if !updateOk {
 		return false
-	} else {
-		//保存修改日志
-		go func() {
-			util.MQFW.Save("subvip_edit_log", map[string]interface{}{
-				"s_userid":         userId,
-				"o_area_old":       (*oldVip)["o_area"],
-				"a_buyerclass_old": (*oldVip)["a_buyerclass"],
-				"o_area":           areaNew,
-				"a_buyerclass":     industryNew,
-				"l_changeTime":     time.Now().Unix(),
-			})
-		}()
 	}
-	return true
+    //保存修改日志
+    go func() {
+        util.MQFW.Save("subvip_edit_log", map[string]interface{}{
+            "s_userid":         userId,
+            "o_area_old":       (*oldVip)["o_area"],
+            "a_buyerclass_old": (*oldVip)["a_buyerclass"],
+            "o_area":           areaNew,
+            "a_buyerclass":     industryNew,
+            "l_changeTime":     time.Now().Unix(),
+        })
+    }()
+    return true
 }
 
 // 获取省份,城市,行业购买内容