Эх сурвалжийг харах

Merge branch 'master' into feature/v2.4.13

lianbingjie 2 жил өмнө
parent
commit
8e1701f287

+ 0 - 3
src/order/orderManageController.go

@@ -1427,9 +1427,6 @@ func UpdateBigOrder(context *admin.Context) (interface{}, error) {
 				ClearBigVipUserPower(qutil.ObjToString(res["user_id"]))
 			}
 			util.JysqlDB.Update("dataexport_order", map[string]interface{}{"user_phone": qutil.ObjToString(res["user_phone"])}, map[string]interface{}{"user_phone": param.Phone, "user_id": userId})
-			if param.BuySubject == "2" {
-
-			}
 		} else {
 			userId = qutil.ObjToString(res["user_id"])
 		}

+ 16 - 8
src/order/orderManageService.go

@@ -3751,8 +3751,10 @@ func NewBigOrder(subStatus, dateType int, startdate, enddate time.Time, userId,
 			log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 			return errors.New("自动创建企业信息失败")
 		} else {
-			paramOrder["entId"] = entId
-			paramOrder["user_id"] = userPositionId
+			if entId != 0 {
+				paramOrder["entId"] = entId
+				paramOrder["user_id"] = userPositionId
+			}
 		}
 		//获取职位标识
 	} else {
@@ -4171,8 +4173,10 @@ func UpdateNewBigOrder(subStatus, dateType int, now, startdate, enddate time.Tim
 			log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 			return errors.New("自动创建企业信息失败")
 		} else {
-			paramOrder["entId"] = entId
-			paramOrder["user_id"] = userPositionId
+			if entId != 0 {
+				paramOrder["entId"] = entId
+				paramOrder["user_id"] = userPositionId
+			}
 		}
 	} else {
 		paramOrder["buySubject"] = 1
@@ -4616,8 +4620,10 @@ func SupplyBigOrder(subStatus, pay_sub_num, free_sub_num, dateType int, now, sta
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return errors.New("自动创建企业信息失败")
 			} else {
-				paramOrder["entId"] = entId
-				paramOrder["user_id"] = userPositionId
+				if entId != 0 {
+					paramOrder["entId"] = entId
+					paramOrder["user_id"] = userPositionId
+				}
 			}
 		} else {
 			paramOrder["buySubject"] = 1
@@ -4925,8 +4931,10 @@ func ExtendBigOrder(subStatus, pay_sub_num, free_sub_num int, now, startdate, en
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return errors.New("自动创建企业信息失败")
 			} else {
-				paramOrder["entId"] = entId
-				paramOrder["user_id"] = userPositionId
+				if entId != 0 {
+					paramOrder["entId"] = entId
+					paramOrder["user_id"] = userPositionId
+				}
 			}
 		} else {
 			paramOrder["buySubject"] = 1

+ 29 - 16
src/order/otherOrderService.go

@@ -135,9 +135,11 @@ func createOtherOrder(param *CreateOtherOrderParams, code string) bool {
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return false
 			} else {
-				insertData["ent_id"] = entId
-				param.UserId = fmt.Sprint(qutil.Int64All(userPositionId))
-				insertData["user_id"] = userPositionId
+				if entId != 0 {
+					insertData["ent_id"] = entId
+					param.UserId = fmt.Sprint(qutil.Int64All(userPositionId))
+					insertData["user_id"] = userPositionId
+				}
 			}
 		} else {
 			insertData["buy_subject"] = 1
@@ -316,9 +318,12 @@ func createEntnicheOrder(param *CreateOtherOrderParams, code string) bool {
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return false
 			} else {
-				insertData["entId"] = entId
-				insertData["user_id"] = userPositionId
-				param.UserId = userPositionId
+				if entId != 0 {
+					insertData["entId"] = entId
+					insertData["user_id"] = userPositionId
+					param.UserId = userPositionId
+				}
+
 			}
 		} else {
 			insertData["buySubject"] = 1
@@ -415,9 +420,11 @@ func updateOtherOrder(param *CreateOtherOrderParams, code string, returnStatus i
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return false
 			} else {
-				insertData["entId"] = entId
-				param.UserId = userPositionId
-				insertData["user_id"] = userPositionId
+				if entId != 0 {
+					insertData["entId"] = entId
+					param.UserId = userPositionId
+					insertData["user_id"] = userPositionId
+				}
 			}
 		} else {
 			insertData["buySubject"] = 1
@@ -583,9 +590,11 @@ func updateEntnicheOrder(param *CreateOtherOrderParams, code string, returnStatu
 				log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", code, err.Error())
 				return false
 			} else {
-				insertData["entId"] = entId
-				param.UserId = userPositionId
-				insertData["user_id"] = userPositionId
+				if entId != 0 {
+					insertData["entId"] = entId
+					param.UserId = userPositionId
+					insertData["user_id"] = userPositionId
+				}
 			}
 		} else {
 			insertData["buySubject"] = 1
@@ -867,8 +876,10 @@ func createVipOrder(param *CreateOtherOrderParams, code string) (bool, string) {
 		}
 		if param.BuySubject == "2" {
 			insertData["buy_subject"] = 2
-			insertData["ent_id"] = entId
-			insertData["user_id"] = userPositionId
+			if entId != 0 {
+				insertData["ent_id"] = entId
+				insertData["user_id"] = userPositionId
+			}
 		} else {
 			insertData["buy_subject"] = 1
 		}
@@ -1216,9 +1227,11 @@ func updateVipOrder(param *CreateOtherOrderParams, code string, returnStatus int
 			delete(contractData, "contract_time")
 		}
 		if param.BuySubject == "2" {
-			insertData["ent_id"] = entId
+			if entId != 0 {
+				insertData["ent_id"] = entId
+				insertData["user_id"] = userPositionId
+			}
 			insertData["buy_subject"] = 2
-			insertData["user_id"] = userPositionId
 		} else {
 			insertData["buy_subject"] = 1
 		}

+ 4 - 2
src/order/suppleSalePerson.go

@@ -587,8 +587,10 @@ func OrdersExamine(context *admin.Context) (interface{}, error) {
 						log.Printf("AutomaticallyCreatingEnt 自动创建企业信息失败:code:%s,err:%s", param.OrderCode, err.Error())
 						return false
 					} else {
-						upData["ent_id"] = entId
-						upData["user_id"] = userPositionId
+						if entId != 0 {
+							upData["ent_id"] = entId
+							upData["user_id"] = userPositionId
+						}
 					}
 				}
 				filterMap := map[string]interface{}{}