|
@@ -57,7 +57,7 @@ func Detail(ctx context.Context, param model.OrderDetailParams) (map[string]inte
|
|
orderMap := orderData.Map()
|
|
orderMap := orderData.Map()
|
|
orderMap["pay_money"] = gconv.Int64(orderMap["new_pay_money"])
|
|
orderMap["pay_money"] = gconv.Int64(orderMap["new_pay_money"])
|
|
orderMap["commission"] = gconv.Int64(orderMap["new_commission"])
|
|
orderMap["commission"] = gconv.Int64(orderMap["new_commission"])
|
|
- payWay := gconv.String(orderData.Map()["pay_way"])
|
|
|
|
|
|
+ payWay := gconv.String(orderMap["pay_way"])
|
|
var table string
|
|
var table string
|
|
switch {
|
|
switch {
|
|
case strings.Contains(payWay, "wx"):
|
|
case strings.Contains(payWay, "wx"):
|
|
@@ -89,7 +89,7 @@ func Detail(ctx context.Context, param model.OrderDetailParams) (map[string]inte
|
|
var (
|
|
var (
|
|
productArr []map[string]interface{}
|
|
productArr []map[string]interface{}
|
|
autoAndAttribute bool
|
|
autoAndAttribute bool
|
|
- isReturnStatus = gconv.Int(orderData.Map()["return_status"]) == 1
|
|
|
|
|
|
+ isReturnStatus = gconv.Int(orderMap["return_status"]) == 1
|
|
)
|
|
)
|
|
if err != nil || productData.IsEmpty() {
|
|
if err != nil || productData.IsEmpty() {
|
|
return nil, err
|
|
return nil, err
|
|
@@ -103,7 +103,7 @@ func Detail(ctx context.Context, param model.OrderDetailParams) (map[string]inte
|
|
)
|
|
)
|
|
//红冲
|
|
//红冲
|
|
redPunch := make(map[string]interface{})
|
|
redPunch := make(map[string]interface{})
|
|
- subject := orderData.Map()["return_commpany"]
|
|
|
|
|
|
+ subject := orderMap["return_commpany"]
|
|
moneyCorrectionData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM moneyCorrection WHERE orderCode =%s order by createTime desc`, param.OrderCode))
|
|
moneyCorrectionData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM moneyCorrection WHERE orderCode =%s order by createTime desc`, param.OrderCode))
|
|
if !moneyCorrectionData.IsEmpty() {
|
|
if !moneyCorrectionData.IsEmpty() {
|
|
for _, m := range moneyCorrectionData.List() {
|
|
for _, m := range moneyCorrectionData.List() {
|
|
@@ -238,12 +238,12 @@ INNER JOIN jy_product_class jpc on jpi.product_class_id = jpc.id WHERE jpi.code
|
|
//关联订单
|
|
//关联订单
|
|
if gconv.String(m["product_type"]) != "大会员" && gconv.String(m["product_type"]) != "VIP订阅" {
|
|
if gconv.String(m["product_type"]) != "大会员" && gconv.String(m["product_type"]) != "VIP订阅" {
|
|
var whereSql string
|
|
var whereSql string
|
|
- if gconv.Int(orderData.Map()["buy_subject"]) == 1 {
|
|
|
|
- whereSql = fmt.Sprintf("dor.user_phone = '%s' and dor.buy_subject =1 and dor.create_time< '%s' ", gconv.String(orderData.Map()["user_phone"]), gconv.String(orderData.Map()["create_time"]))
|
|
|
|
|
|
+ if gconv.Int(orderMap["buy_subject"]) == 1 {
|
|
|
|
+ whereSql = fmt.Sprintf("dor.user_phone = '%s' and dor.buy_subject =1 and dor.create_time< '%s' ", gconv.String(orderMap["user_phone"]), gconv.String(orderMap["create_time"]))
|
|
} else {
|
|
} else {
|
|
whereSql = fmt.Sprintf("dor.user_phone = '%s' and dor.buy_subject =2 and dor.company_name ='%s' and dor.create_time< '%s' ", gconv.String(orderData.Map()["user_phone"]), gconv.String(orderData.Map()["company_name"]), gconv.String(orderData.Map()["create_time"]))
|
|
whereSql = fmt.Sprintf("dor.user_phone = '%s' and dor.buy_subject =2 and dor.company_name ='%s' and dor.create_time< '%s' ", gconv.String(orderData.Map()["user_phone"]), gconv.String(orderData.Map()["company_name"]), gconv.String(orderData.Map()["create_time"]))
|
|
}
|
|
}
|
|
- if linkedOrder := user.SpecialService(ctx, whereSql, gconv.String(m["product_type"]), gconv.Int(orderData.Map()["buy_subject"])); linkedOrder != nil {
|
|
|
|
|
|
+ if linkedOrder := user.SpecialService(ctx, whereSql, gconv.String(m["product_type"]), gconv.Int(orderMap["buy_subject"])); linkedOrder != nil {
|
|
m["linkedOrder"] = linkedOrder
|
|
m["linkedOrder"] = linkedOrder
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -263,7 +263,7 @@ INNER JOIN jy_product_class jpc on jpi.product_class_id = jpc.id WHERE jpi.code
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
areaCount = ttt.FinalAreaCount
|
|
areaCount = ttt.FinalAreaCount
|
|
- paySubNum = gconv.Int(common.If(gconv.Int(orderData.Map()["buy_subject"]) == 1, 1, ttt.FinalAccountCount))
|
|
|
|
|
|
+ paySubNum = gconv.Int(common.If(gconv.Int(orderMap["buy_subject"]) == 1, 1, ttt.FinalAccountCount))
|
|
case "大会员":
|
|
case "大会员":
|
|
var ttt model.JyBigProductFilter
|
|
var ttt model.JyBigProductFilter
|
|
if err = gconv.Struct(linkedDetail.Map()["filter"], &ttt); err != nil {
|
|
if err = gconv.Struct(linkedDetail.Map()["filter"], &ttt); err != nil {
|
|
@@ -273,7 +273,7 @@ INNER JOIN jy_product_class jpc on jpi.product_class_id = jpc.id WHERE jpi.code
|
|
paySubNum = ttt.FinalAccountCount
|
|
paySubNum = ttt.FinalAccountCount
|
|
}
|
|
}
|
|
|
|
|
|
- switch gconv.Int(orderData.Map()["buy_subject"]) {
|
|
|
|
|
|
+ switch gconv.Int(orderMap["buy_subject"]) {
|
|
case 1:
|
|
case 1:
|
|
buySubject = 1
|
|
buySubject = 1
|
|
orderProduct, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.id,a.service_type,b.order_code,b.create_time,a.service_starttime,a.service_endtime FROM jy_order_detail a
|
|
orderProduct, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.id,a.service_type,b.order_code,b.create_time,a.service_starttime,a.service_endtime FROM jy_order_detail a
|
|
@@ -441,10 +441,10 @@ WHERE eo.wait_empower_id = %s and jod.is_service_open =1 and jod.status =1 and d
|
|
returnArr = append(returnArr, d)
|
|
returnArr = append(returnArr, d)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if gconv.Int(orderData.Map()["is_backstage_order"]) == 0 && gconv.Int(orderData.Map()["order_status"]) == 1 &&
|
|
|
|
- gconv.Int(orderData.Map()["pay_money"]) > 0 && gconv.Int(orderData.Map()["return_status"]) == 0 &&
|
|
|
|
|
|
+ if gconv.Int(orderMap["is_backstage_order"]) == 0 && gconv.Int(orderMap["order_status"]) == 1 &&
|
|
|
|
+ gconv.Int(orderMap["pay_money"]) > 0 && gconv.Int(orderMap["return_status"]) == 0 &&
|
|
!strings.Contains(payWay, "transferAccounts") {
|
|
!strings.Contains(payWay, "transferAccounts") {
|
|
- returnMoney = gconv.Int(orderData.Map()["pay_money"])
|
|
|
|
|
|
+ returnMoney = gconv.Int(orderMap["pay_money"])
|
|
}
|
|
}
|
|
if gconv.Int(orderMap["return_status"]) == 1 {
|
|
if gconv.Int(orderMap["return_status"]) == 1 {
|
|
returnMoney = gconv.Int(orderMap["pay_money"])
|
|
returnMoney = gconv.Int(orderMap["pay_money"])
|
|
@@ -499,9 +499,9 @@ LEFT JOIN jy_product_class jc on ji.product_class_id = jc.id WHERE de.id =? and
|
|
refundList = append(refundList, datum)
|
|
refundList = append(refundList, datum)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if gconv.Int(orderData.Map()["is_backstage_order"]) == 0 && gconv.Int(orderData.Map()["order_status"]) == 1 &&
|
|
|
|
- gconv.Int(orderData.Map()["pay_money"]) > 0 {
|
|
|
|
- returnMoney = gconv.Int(orderData.Map()["pay_money"])
|
|
|
|
|
|
+ if gconv.Int(orderMap["is_backstage_order"]) == 0 && gconv.Int(orderMap["order_status"]) == 1 &&
|
|
|
|
+ gconv.Int(orderMap["pay_money"]) > 0 {
|
|
|
|
+ returnMoney = gconv.Int(orderMap["pay_money"])
|
|
}
|
|
}
|
|
result["refundRes"] = map[string]interface{}{
|
|
result["refundRes"] = map[string]interface{}{
|
|
"refundMoney": refundMoney,
|
|
"refundMoney": refundMoney,
|
|
@@ -623,13 +623,13 @@ WHERE order_code = '%s' and status = 0 order by create_time desc `, param.OrderC
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if invoiceMoney > 0 {
|
|
if invoiceMoney > 0 {
|
|
- orderMap["invoiced_status"] = common.If(gconv.Int(orderData.Map()["pay_money"])-invoiceMoney <= 0, 2, 3)
|
|
|
|
|
|
+ orderMap["invoiced_status"] = common.If(gconv.Int(orderMap["pay_money"])-invoiceMoney <= 0, 2, 3)
|
|
} else {
|
|
} else {
|
|
orderMap["invoiced_status"] = 0 //未开票
|
|
orderMap["invoiced_status"] = 0 //未开票
|
|
}
|
|
}
|
|
result["invoiceData"] = map[string]interface{}{
|
|
result["invoiceData"] = map[string]interface{}{
|
|
"invoiceMoney": invoiceMoney,
|
|
"invoiceMoney": invoiceMoney,
|
|
- "remainingMoney": gconv.Int(orderData.Map()["pay_money"]) - invoiceMoney,
|
|
|
|
|
|
+ "remainingMoney": gconv.Int(orderMap["pay_money"]) - invoiceMoney,
|
|
"invoiceInfo": invoiceList,
|
|
"invoiceInfo": invoiceList,
|
|
}
|
|
}
|
|
result["orderData"] = orderMap
|
|
result["orderData"] = orderMap
|