|
@@ -27,7 +27,7 @@ const (
|
|
|
RefundStatusFailed RefundStatus = "failed"
|
|
|
RefundStatusProcessing RefundStatus = "processing"
|
|
|
|
|
|
- detailColumn = "id,order_id,user_id,template_user_id,product_id,status,created_time,updated_time,total_amount,expired_time,real_name,mobile,area_code,product_type,product_name,valid_duration"
|
|
|
+ detailColumn = "id,order_id,user_id,template_user_id,real_name,area_code,mobile,product_id,product_type,product_name,status,created_time,updated_time,total_amount,expired_time,valid_duration"
|
|
|
)
|
|
|
|
|
|
type ProductOrder struct {
|
|
@@ -42,7 +42,7 @@ type ProductOrder struct {
|
|
|
ProductType merchantDao.MerchantProductType `gorm:"column:product_type;default:null;comment:'产品类型'" json:"product_type"`
|
|
|
ProductName string `gorm:"column:product_name;default:null;comment:'商品名称'" json:"product_name"`
|
|
|
TotalAmount string `gorm:"column:total_amount;size:255;default:null;comment:'金额'" json:"total_amount"`
|
|
|
- TradeID int `gorm:"column:trade_id;default:null;comment:'支付订单'" json:"trade_id"`
|
|
|
+ TradeId int `gorm:"column:trade_id;default:null;comment:'支付订单'" json:"trade_id"`
|
|
|
TradeNO string `gorm:"column:trade_no;default:null;comment:'支付订单'" json:"trade_no"`
|
|
|
PaymentAmount string `gorm:"column:payment_amount;;comment:'支付金额'"`
|
|
|
PaymentWay PaymentWay `gorm:"column:payment_way;enum('wechat','alipay');default:null;comment:'支付渠道'"`
|
|
@@ -154,12 +154,12 @@ func BatchCloseOrder(ids []int) (err error) {
|
|
|
|
|
|
func GetOrderByUser(templateUserId int, orderNo string) (order ProductOrder, err error) {
|
|
|
db := models.Main()
|
|
|
- err = db.Model(&ProductOrder{}).Select(detailColumn).Where("template_user_id= ? and order_id=? and is_deleted=0 ", templateUserId, orderNo).First(&order).Error
|
|
|
+ err = db.Model(&ProductOrder{}).Select("*").Where("template_user_id= ? and order_id=? and is_deleted=0 ", templateUserId, orderNo).First(&order).Error
|
|
|
return
|
|
|
}
|
|
|
func GetOrderByOrderNo(orderNo string) (order ProductOrder, err error) {
|
|
|
db := models.Main()
|
|
|
- err = db.Model(&ProductOrder{}).Select(detailColumn).Where("order_id=? and is_deleted=0 ", orderNo).First(&order).Error
|
|
|
+ err = db.Model(&ProductOrder{}).Select("*").Where("order_id=? and is_deleted=0 ", orderNo).First(&order).Error
|
|
|
return
|
|
|
}
|
|
|
func CloseProductOrder(templateUserId int, productOrderNo string) (err error) {
|