价格统计

This commit is contained in:
苏尹岚
2020-01-02 17:49:57 +08:00
parent 7b8d37a6bd
commit 299dc1a883
3 changed files with 67 additions and 16 deletions

View File

@@ -191,10 +191,6 @@ func GetGetStatisticsReportForAfsOrders(db *DaoDB, storeIDs []int, fromDate time
func GetStatisticsReportForStoreSkusPrice(db *DaoDB, cityCodes, skuIDs []int) (priceReferSnapshot []*model.PriceReferSnapshot, err error) {
sql := `
SELECT b.city_code,a.sku_id,c.name_id,
ROUND(MAX(a.unit_price/IF(b.pay_percentage < 50,70,b.pay_percentage)*100)) max_unit_price,
ROUND(MIN(a.unit_price/IF(b.pay_percentage < 50,70,b.pay_percentage)*100)) min_unit_price,
ROUND(AVG(a.unit_price/IF(b.pay_percentage < 50,70,b.pay_percentage)*100)) avg_unit_price,
ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT((a.unit_price/IF(b.pay_percentage < 50,70,b.pay_percentage))*100 ORDER BY (a.unit_price/IF(b.pay_percentage < 50,70,b.pay_percentage))*100),',',Count(1)/2),',',-1)) mid_unit_price,
MAX(a.jd_price) max_jd_price,
MIN(a.jd_price) min_jd_price,
ROUND(AVG(a.jd_price)) avg_jd_price,

View File

@@ -347,7 +347,7 @@ type OrderPayRefund struct {
type OrderSupplementFee struct {
ModelIDCULD
StoreID int `orm:"column(store_id)" json:"storeID"`
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
VendorOrderID *string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
VendorID *string `orm:"column(vendor_id)" json:"vendorID"`
Status int `json:"status"` //账单状态,若已结账则不允许再修改 ,暂时 0为未结账1为已结账,-1为作废
LinkID int `orm:"column(link_id)" json:"linkID"` //作为冲账标志关联某条扣款记录