增加价格排序

This commit is contained in:
qiyunfanbo126.com 2024-07-31 09:22:18 +08:00
parent c9458d0b60
commit 4fb1362c6c
4 changed files with 16 additions and 1 deletions

View File

@ -85,6 +85,12 @@ func OrderRefund(c *gin.Context) {
controllers.HandCodeRes(c, nil, code) controllers.HandCodeRes(c, nil, code)
} }
func OrderDelete(c *gin.Context) {
var request = controllers.GetRequest(c).(*front.OrderQueryRequest)
err := services.OrderDelete(request.OrderId)
controllers.HandRes(c, nil, err)
}
func OrderNotify(c *gin.Context) { func OrderNotify(c *gin.Context) {
c.Header("method", "unionpay.b2cNotify") c.Header("method", "unionpay.b2cNotify")
c.Header("merchantId", config.GetConf().YouChu.MerchantId) c.Header("merchantId", config.GetConf().YouChu.MerchantId)

View File

@ -22,4 +22,6 @@ var FrontRequestMap = map[string]func() interface{}{
common.FRONT_API_V1_Auth + "/order/query": func() interface{} { return new(front.OrderQueryRequest) }, common.FRONT_API_V1_Auth + "/order/query": func() interface{} { return new(front.OrderQueryRequest) },
//退款订单 //退款订单
common.FRONT_API_V1_Auth + "/order/refund": func() interface{} { return new(front.OrderQueryRequest) }, common.FRONT_API_V1_Auth + "/order/refund": func() interface{} { return new(front.OrderQueryRequest) },
//退款订单
common.FRONT_API_V1_Auth + "/order/delete": func() interface{} { return new(front.OrderQueryRequest) },
} }

View File

@ -4,6 +4,7 @@ package routes
* 配置路由 * 配置路由
*/ */
import ( import (
ginSwagger "github.com/swaggo/gin-swagger"
"qteam/app/constants/common" "qteam/app/constants/common"
"qteam/app/http/controllers" "qteam/app/http/controllers"
"qteam/app/http/controllers/front" "qteam/app/http/controllers/front"
@ -15,7 +16,6 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/qit-team/snow-core/http/middleware" "github.com/qit-team/snow-core/http/middleware"
"github.com/qit-team/snow-core/log/logger" "github.com/qit-team/snow-core/log/logger"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles" "github.com/swaggo/gin-swagger/swaggerFiles"
) )
@ -72,6 +72,7 @@ func RegisterRoute(router *gin.Engine) {
order.POST("/list", front.OrderList) order.POST("/list", front.OrderList)
order.POST("/query", front.OrderQuery) order.POST("/query", front.OrderQuery)
order.POST("/refund", front.OrderRefund) order.POST("/refund", front.OrderRefund)
order.POST("/delete", front.OrderDelete)
} }
} }
} }

View File

@ -97,6 +97,7 @@ func CreateOrderService(userId int, productId int) (code int, data front.InsertO
func OrderQueryService(userId int, OrderRequest *front.OrderListRequest) (code int, data []ordersmodel.OrdersProductsList, count int64) { func OrderQueryService(userId int, OrderRequest *front.OrderListRequest) (code int, data []ordersmodel.OrdersProductsList, count int64) {
repo := ordersmodel.GetInstance().GetDb() repo := ordersmodel.GetInstance().GetDb()
conn := builder.NewCond() conn := builder.NewCond()
conn.And(builder.IsNull{"Delete"})
if config.GetConf().Debug == false { if config.GetConf().Debug == false {
conn = conn.And(builder.Eq{"a.user_id": userId}) conn = conn.And(builder.Eq{"a.user_id": userId})
} }
@ -186,6 +187,11 @@ func OrderRefundService(userId int, orderId int) (code int) {
} }
} }
func OrderDelete(id string) error {
_, err := ordersmodel.GetInstance().GetDb().Where("id = ?", id).Update(ordersmodel.Orders{Deleted: time.Now()})
return err
}
func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderNotifyResponse) { func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderNotifyResponse) {
requestStr, _ := json.Marshal(request) requestStr, _ := json.Marshal(request)
utils.Log(nil, "订单回调请求--原始数据:", string(requestStr)) utils.Log(nil, "订单回调请求--原始数据:", string(requestStr))