From c276ffa0db6fe5878bc673139515dd910ece6164 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:02:02 +0800 Subject: [PATCH 1/9] log --- business/q_bida/q_bida_server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 1d7586c3e..5bf00c1fe 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -201,6 +201,7 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd // 查询订单 globals.SugarLogger.Debug("userid==================", userId) order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} + globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.OtherWayBill) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err } From 10b69be9c8b885005ebef725a0a9da74b561d976 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:08:09 +0800 Subject: [PATCH 2/9] log --- business/q_bida/q_bida_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 5bf00c1fe..1ea4b2717 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -200,7 +200,8 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrderReq) error { // 查询订单 globals.SugarLogger.Debug("userid==================", userId) - order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} + //order:=get + order := model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.OtherWayBill) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err From d0fb1bfd8d3e57bcb6145893a7a5c4f87991315e Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:09:47 +0800 Subject: [PATCH 3/9] log --- business/q_bida/q_bida_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 1ea4b2717..ed5c06bd3 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -201,8 +201,8 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd // 查询订单 globals.SugarLogger.Debug("userid==================", userId) //order:=get - order := model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} - globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.OtherWayBill) + order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} + globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %v ", &order.OtherWayBill) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err } From dac9a6b805f08588ecf950e7158a83e9630beeef Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:18:59 +0800 Subject: [PATCH 4/9] log --- business/q_bida/q_bida_server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index ed5c06bd3..467f72ce3 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -200,9 +200,12 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrderReq) error { // 查询订单 globals.SugarLogger.Debug("userid==================", userId) + globals.SugarLogger.Debug("param.order_no==================", param.OrderNo) //order:=get order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} - globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %v ", &order.OtherWayBill) + //orders, err := QueryOrderDetail(param.Type, param.OrderNo) + //order := &orders + globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %v ", order.OtherWayBill) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err } From 18c27229e64cf77f839328a2af5aac146988f088 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:23:48 +0800 Subject: [PATCH 5/9] log --- business/q_bida/q_bida_server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 467f72ce3..cdb41185d 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -205,8 +205,11 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} //orders, err := QueryOrderDetail(param.Type, param.OrderNo) //order := &orders - globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %v ", order.OtherWayBill) + globals.SugarLogger.Debugf("dgergergesgreger== %s ", order.OtherWayBill) + globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.LastOperator) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { + globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) + globals.SugarLogger.Debugf("jbhbhjdsgbgjhghiwsg== %s ", order.LastOperator) return err } From 4a3f6b114c497146b787893b55edf24129e7ab66 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:26:53 +0800 Subject: [PATCH 6/9] log --- business/q_bida/q_bida_server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index cdb41185d..f180b76e1 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -208,11 +208,11 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd globals.SugarLogger.Debugf("dgergergesgreger== %s ", order.OtherWayBill) globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.LastOperator) if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { - globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) - globals.SugarLogger.Debugf("jbhbhjdsgbgjhghiwsg== %s ", order.LastOperator) + return err } - + globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) + globals.SugarLogger.Debugf("jbhbhjdsgbgjhghiwsg== %s ", order.LastOperator) if time.Now().Unix()-order.CreatedAt.Unix() <= 30 { return errors.New("支付成功后,超过30s才能取消") } From e2b3637d9a4a911724154dc8e2219f37033b76c0 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:43:21 +0800 Subject: [PATCH 7/9] log --- business/jxstore/financial/bill.go | 1 - business/model/dao/dao_user.go | 16 ++++++++++++++++ business/q_bida/q_bida_server.go | 12 +++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/business/jxstore/financial/bill.go b/business/jxstore/financial/bill.go index 14ccf8cd0..6f6b9cdae 100644 --- a/business/jxstore/financial/bill.go +++ b/business/jxstore/financial/bill.go @@ -218,7 +218,6 @@ func WXInvestMemberNew(ctx *jxcontext.Context, memberID int, userID string) (err } else { userMember2.EndAt = time.Now().AddDate(1, 0, 0) } - //////// userinfo, err := dao.GetUser(db, userMember2.UserID) if err != nil { return "", err diff --git a/business/model/dao/dao_user.go b/business/model/dao/dao_user.go index f6ddad51f..6c5cb6ebf 100644 --- a/business/model/dao/dao_user.go +++ b/business/model/dao/dao_user.go @@ -436,3 +436,19 @@ func GetUserUnionBindImg(db *DaoDB, unionID, actID string) (userBinds *model.Use err = GetRow(db, &userBinds, sql, sqlParams) return userBinds, err } +func GetUserVendorOrder(db *DaoDB, userID, localWayBill string) (userVendorOrder *model.UserVendorOrder, err error) { + sql := `SELECT * FROM user_vendor_order WHERE ` + sqlParams := []interface{}{ + utils.DefaultTimeValue, + } + if userID != "" { + sql += " user_id = ?" + sqlParams = append(sqlParams, userID) + } + if localWayBill != "" { + sql += " AND local_way_bill = ?" + sqlParams = append(sqlParams, localWayBill) + } + err = GetRow(db, &userVendorOrder, sql, sqlParams) + return userVendorOrder, err +} diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index f180b76e1..bc5c67e8d 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -198,17 +198,19 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user // CancelWayOrder 取消运单 todo func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrderReq) error { + var db = dao.GetDB() // 查询订单 globals.SugarLogger.Debug("userid==================", userId) globals.SugarLogger.Debug("param.order_no==================", param.OrderNo) - //order:=get - order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} - //orders, err := QueryOrderDetail(param.Type, param.OrderNo) - //order := &orders + //order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} + order, err := dao.GetUserVendorOrder(db, userId, param.OrderNo) + if err != nil { + return err + } globals.SugarLogger.Debugf("dgergergesgreger== %s ", order.OtherWayBill) globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.LastOperator) - if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { + if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err } globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) From 2a19d7a4a7cc9a8d5567d750ad7ca907e566fb84 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 10:48:29 +0800 Subject: [PATCH 8/9] add --- business/model/dao/dao_user.go | 4 ++-- business/q_bida/q_bida_server.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/business/model/dao/dao_user.go b/business/model/dao/dao_user.go index 6c5cb6ebf..9e3eb9c2a 100644 --- a/business/model/dao/dao_user.go +++ b/business/model/dao/dao_user.go @@ -437,12 +437,12 @@ func GetUserUnionBindImg(db *DaoDB, unionID, actID string) (userBinds *model.Use return userBinds, err } func GetUserVendorOrder(db *DaoDB, userID, localWayBill string) (userVendorOrder *model.UserVendorOrder, err error) { - sql := `SELECT * FROM user_vendor_order WHERE ` + sql := `SELECT * FROM user_vendor_order WHERE deleted_at = ? ` sqlParams := []interface{}{ utils.DefaultTimeValue, } if userID != "" { - sql += " user_id = ?" + sql += "AND user_id = ?" sqlParams = append(sqlParams, userID) } if localWayBill != "" { diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index bc5c67e8d..2a4a20d13 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -210,9 +210,9 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd globals.SugarLogger.Debugf("dgergergesgreger== %s ", order.OtherWayBill) globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.LastOperator) - if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { - return err - } + //if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { + // return err + //} globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) globals.SugarLogger.Debugf("jbhbhjdsgbgjhghiwsg== %s ", order.LastOperator) if time.Now().Unix()-order.CreatedAt.Unix() <= 30 { From 9214513cff7a75d6ab8054f3fa68bb8dbfa4d0b3 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 27 Jul 2022 13:38:14 +0800 Subject: [PATCH 9/9] rollback --- business/q_bida/q_bida_server.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 2a4a20d13..a01f06e1b 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -198,21 +198,14 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user // CancelWayOrder 取消运单 todo func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrderReq) error { - var db = dao.GetDB() // 查询订单 globals.SugarLogger.Debug("userid==================", userId) globals.SugarLogger.Debug("param.order_no==================", param.OrderNo) - //order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} - order, err := dao.GetUserVendorOrder(db, userId, param.OrderNo) - if err != nil { + + order := &model.UserVendorOrder{UserId: userId, LocalWayBill: param.OrderNo} + if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { return err } - globals.SugarLogger.Debugf("dgergergesgreger== %s ", order.OtherWayBill) - globals.SugarLogger.Debugf("hjghauifhwquihfuiojqw== %s ", order.LastOperator) - - //if err := dao.GetEntity(dao.GetDB(), order, "UserId", "LocalWayBill"); err != nil { - // return err - //} globals.SugarLogger.Debugf("sdhgeagqweg344w33qgweag== %s ", order.OtherWayBill) globals.SugarLogger.Debugf("jbhbhjdsgbgjhghiwsg== %s ", order.LastOperator) if time.Now().Unix()-order.CreatedAt.Unix() <= 30 {