|
|
@@ -400,7 +400,7 @@ func NursingHomeBuyPackageReq(c *gin.Context, req md.NursingHomeBuyPackageReq) ( |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func DealCentralKitchenForSchoolOrderCallBack(outTradeNo, tradeStatus string) (state int, err error) { |
|
|
|
func DealCentralKitchenForSchoolOrderCallBack(outTradeNo, tradeStatus, successTime string) (state int, err error) { |
|
|
|
centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{} |
|
|
|
centralKitchenForSchoolPackageOrd.Set(outTradeNo) |
|
|
|
ord, err := centralKitchenForSchoolPackageOrd.GetCentralKitchenForSchoolPackageOrd() |
|
|
@@ -420,6 +420,7 @@ func DealCentralKitchenForSchoolOrderCallBack(outTradeNo, tradeStatus string) (s |
|
|
|
if tradeStatus == "TRADE_SUCCESS" { |
|
|
|
ord.State = enum2.CentralKitchenForSchoolPackageOrdStateForSuccess |
|
|
|
ord.OrdState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForSuccess |
|
|
|
ord.PayAt = successTime |
|
|
|
|
|
|
|
//TODO::将预留数据插入到 `central_kitchen_for_school_user_with_day` |
|
|
|
var data []*model.CentralKitchenForSchoolUserWithDay |
|
|
@@ -493,7 +494,7 @@ func DealCentralKitchenForSchoolOrderCallBack(outTradeNo, tradeStatus string) (s |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_, err = centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(ord, "state", "ord_state") |
|
|
|
_, err = centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(ord, "state", "ord_state", "pay_at") |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
@@ -502,7 +503,7 @@ func DealCentralKitchenForSchoolOrderCallBack(outTradeNo, tradeStatus string) (s |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func DealCentralKitchenForSchoolOrderCallBackForWx(outTradeNo, transactionId, tradeStatus string) (state int, err error) { |
|
|
|
func DealCentralKitchenForSchoolOrderCallBackForWx(outTradeNo, transactionId, tradeStatus, successTime string) (state int, err error) { |
|
|
|
centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{} |
|
|
|
centralKitchenForSchoolPackageOrd.Set(outTradeNo) |
|
|
|
ord, err := centralKitchenForSchoolPackageOrd.GetCentralKitchenForSchoolPackageOrd() |
|
|
@@ -523,6 +524,7 @@ func DealCentralKitchenForSchoolOrderCallBackForWx(outTradeNo, transactionId, tr |
|
|
|
ord.State = enum2.CentralKitchenForSchoolPackageOrdStateForSuccess |
|
|
|
ord.OrdState = enum2.CentralKitchenForSchoolPackageOrdOrdStateForSuccess |
|
|
|
ord.TradeNo = transactionId |
|
|
|
ord.PayAt = successTime |
|
|
|
|
|
|
|
//TODO::将预留数据插入到 `central_kitchen_for_school_user_with_day` |
|
|
|
var data []*model.CentralKitchenForSchoolUserWithDay |
|
|
@@ -596,7 +598,7 @@ func DealCentralKitchenForSchoolOrderCallBackForWx(outTradeNo, transactionId, tr |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_, err = centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(ord, "state", "ord_state", "trade_no") |
|
|
|
_, err = centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(ord, "state", "ord_state", "trade_no", "pay_at") |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|