|
@@ -22,6 +22,7 @@ type Order struct {
|
|
|
Amount decimal.Decimal `gorm:"column:amount" json:"amount"`
|
|
|
Amount1 decimal.Decimal `gorm:"column:amount_1" json:"amount1"`
|
|
|
Amount2 decimal.Decimal `gorm:"column:amount_2" json:"amount2"`
|
|
|
+ OrderAmount decimal.Decimal `gorm:"column:order_amount" json:"orderAmount"`
|
|
|
}
|
|
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
@@ -115,7 +116,7 @@ func (o *Order) GetOrderList(pageSize int, pageIndex int) ([]Order, int, error)
|
|
|
table = table.Where("p_id = ? ", o.PID)
|
|
|
|
|
|
var count int
|
|
|
- if err := table.Select("order_id,promotion_amount,p_id,order_status,order_status_desc,goods_name,goods_thumbnail_url,order_group_success_time,amount,amount_1,amount_2,order_sn,DATE_FORMAT(order_create_time,'%Y-%m-%d %H:%i:%s') as order_create_time").Order("id desc").Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
|
|
|
+ if err := table.Select("order_id,promotion_amount,p_id,order_status,order_status_desc,goods_name,goods_thumbnail_url,order_group_success_time,amount,amount_1,amount_2,order_sn,DATE_FORMAT(order_create_time,'%Y-%m-%d %H:%i:%s') as order_create_time,order_amount").Order("id desc").Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
|
|
|
return nil, 0, err
|
|
|
}
|
|
|
table.Count(&count)
|