Browse Source

fix:详情修改

duxin 1 month ago
parent
commit
a125aed72a

+ 1 - 1
internal/logic/order/detail.go

@@ -278,7 +278,7 @@ INNER JOIN jy_product_class jpc on jpi.product_class_id = jpc.id WHERE jpi.code
 					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
 INNER JOIN dataexport_order b on a.order_code = b.order_code
-WHERE a.status = 1 and a.is_service_open = 1 and b.user_id = '%s' and b.create_time< '%s' and a.product_type like '%s' ORDER BY b.create_time desc `, gconv.String(orderMap["user_id"]), orderMap["create_time"], common.If(gconv.String(m["product_type"]) == "VIP订阅", "%VIP订阅%", "%大会员%")))
+WHERE a.status = 1 and a.is_service_open = 1 and b.user_phone = '%s' and b.create_time< '%s' and b.buy_subject = 1  and a.product_type like '%s' ORDER BY b.create_time desc `, gconv.String(orderMap["user_phone"]), orderMap["create_time"], common.If(gconv.String(m["product_type"]) == "VIP订阅", "%VIP订阅%", "%大会员%")))
 					if !orderData.IsEmpty() {
 						for _, m2 := range orderProduct.List() {
 							if endTime == "" && gconv.String(m2["service_endtime"]) != "" {

+ 1 - 1
internal/logic/product/bigmember/bigcommon.go

@@ -315,7 +315,7 @@ func (p jyBigProduct) UserPdfDistribution(ctx context.Context, endDate time.Time
 func EntEquityUser(ctx context.Context, waitEmpowerId int) []map[string]interface{} {
 	data, err := g.DB().Ctx(ctx).GetAll(ctx, fmt.Sprintf(`SELECT a.ent_id,a.ent_user_id,d.id as positionId FROM entniche_power a
 INNER JOIN entniche_user b on a.ent_user_id=b.id 
-INNER JOIN base_service.base_user c on c.phone = b.phone
+INNER JOIN base_service.base_user c on c.phone = b.phone COLLATE utf8mb4_unicode_ci
 INNER JOIN base_service.base_position d on c.id = d.user_id and a.ent_id = d.ent_id
 WHERE a.wait_empower_id = %d and status =1 `, waitEmpowerId))
 	if err != nil || data.IsEmpty() {

+ 4 - 4
internal/logic/timedTask/automaticPayment.go

@@ -1,7 +1,6 @@
 package timedTask
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
 	"context"
 	"encoding/json"
 	"fmt"
@@ -111,8 +110,8 @@ WHERE
 					}
 					orderCode := gconv.String(o["order_code"])
 					if PaymentPlanMatching(money, returnMoney, paymentUser, companyName, remark, remarks, orderCode, filterMap[orderCode].PaybackNum, filterMap[orderCode].paybackListArr, returnOrderMap) {
-						isExists, err := redis.Exists("qmx_filter", "qmx_auto_return_"+fmt.Sprint(id))
-						if !isExists || err != nil {
+						isExists, err := g.Redis("qmx_filter").Exists(ctx, "qmx_auto_return_"+fmt.Sprint(id))
+						if isExists == 0 || err != nil {
 							log.Println("自动回款匹配成功", id, orderCode)
 							var returned_money int
 							if calculation, _ := g.DB().GetOne(ctx, fmt.Sprintf("SELECT SUM(return_money) as returned_money  FROM return_money_record WHERE order_code=%s AND state=1", orderCode)); !calculation.IsEmpty() {
@@ -143,7 +142,7 @@ WHERE
 							}
 							updateData := map[string]interface{}{"return_status": 2, "order_status": 1}
 							if returned_money+returnMoney == money {
-								redis.Put("qmx_filter", "qmx_auto_return_"+fmt.Sprint(id), 1, 3600)
+								g.Redis("qmx_filter").SetEX(ctx, "qmx_auto_return_"+fmt.Sprint(id), 1, 3600)
 								updateData["return_status"] = 1
 							}
 							if returnId > 0 {
@@ -180,6 +179,7 @@ WHERE
 											m["reqCompanyName"] = o["company_name"]
 											m["reqSubject"] = o["buy_subject"]
 											productCode := gconv.String(m["product_code"])
+											m["linked_orderId"] = m["linked_detail_id"]
 											pFunc, err := product.JyProFunc.GetProductInitFuncByCode(productCode)
 											if err != nil {
 												continue