Browse Source

订单修改

WH01243 2 years ago
parent
commit
3075a9c5ff
1 changed files with 10 additions and 14 deletions
  1. 10 14
      src/order/otherOrderService.go

+ 10 - 14
src/order/otherOrderService.go

@@ -949,7 +949,6 @@ func createVipOrder(param *CreateOtherOrderParams, code string) (bool, string) {
 			if param.BuySubject == "1" {
 			if param.BuySubject == "1" {
 				isOk = StartSubVip(set, userId)
 				isOk = StartSubVip(set, userId)
 			} else {
 			} else {
-
 				isOk = UpdateRule(entId, map[string]interface{}{
 				isOk = UpdateRule(entId, map[string]interface{}{
 					"$set": set,
 					"$set": set,
 				}, param.Phone)
 				}, param.Phone)
@@ -1928,15 +1927,14 @@ func UpdateRule(entId int, update map[string]interface{}, phone string) bool {
 			}
 			}
 		}
 		}
 		ok1, ok2 := false, false
 		ok1, ok2 := false, false
-		log.Println(up1)
+		userData := util.JysqlDB.FindOne("entniche_user", map[string]interface{}{
+			"ent_id": entId,
+			"phone":  phone,
+		}, `id`, "")
+		if userData == nil {
+			return false
+		}
 		if len(up1) > 0 {
 		if len(up1) > 0 {
-			userData := util.JysqlDB.FindOne("entniche_user", map[string]interface{}{
-				"ent_id": entId,
-				"phone":  phone,
-			}, `id`, "")
-			if userData == nil {
-				return false
-			}
 			ok1 = util.MQFW.Update("ent_user", map[string]interface{}{
 			ok1 = util.MQFW.Update("ent_user", map[string]interface{}{
 				"i_entid":  entId,
 				"i_entid":  entId,
 				"i_userid": (*userData)["id"],
 				"i_userid": (*userData)["id"],
@@ -1944,11 +1942,9 @@ func UpdateRule(entId int, update map[string]interface{}, phone string) bool {
 		}
 		}
 		if len(up2) > 0 {
 		if len(up2) > 0 {
 			ok2 = util.MQFW.Update("entniche_rule", map[string]interface{}{
 			ok2 = util.MQFW.Update("entniche_rule", map[string]interface{}{
-				"i_entid": entId,
-				"i_userid": map[string]interface{}{
-					"$exists": false,
-				},
-				"i_type": tp,
+				"i_entid":  entId,
+				"i_userid": (*userData)["id"],
+				"i_type":   tp,
 			}, up2, true, false)
 			}, up2, true, false)
 		}
 		}
 		return ok1 || ok2
 		return ok1 || ok2