- up
This commit is contained in:
@@ -176,7 +176,7 @@ func GetStoresOrderSaleInfo(db *DaoDB, storeIDList []int, fromTime time.Time, to
|
||||
sql += fmt.Sprintf(`
|
||||
UNION
|
||||
SELECT IF(t0.jx_store_id > 0, t0.jx_store_id, t0.store_id) store_id, t0.vendor_id, -1 status,
|
||||
COUNT(*) count, SUM(t1.shop_price) shop_price, SUM(t1.vendor_price) vendor_price, SUM(t1.sale_price) sale_price, 0 actual_pay_price,
|
||||
COUNT(DISTINCT(t0.id)) count, SUM(t1.shop_price) shop_price, SUM(t1.vendor_price) vendor_price, SUM(t1.sale_price) sale_price, 0 actual_pay_price,
|
||||
CAST(SUM(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t5.pay_percentage > 0, t5.pay_percentage, %d) / 100)) AS SIGNED) earning_price
|
||||
FROM afs_order t0
|
||||
JOIN order_sku_financial t2 ON t2.afs_order_id = t0.afs_order_id AND t2.vendor_id = t0.vendor_id AND t2.is_afs_order = 1
|
||||
@@ -195,6 +195,7 @@ func GetStoresOrderSaleInfo(db *DaoDB, storeIDList []int, fromTime time.Time, to
|
||||
GROUP BY 1,2,3`
|
||||
|
||||
sql += " ORDER BY 1,2,3"
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
err = GetRows(db, &saleInfoList, sql, sqlParams...)
|
||||
return saleInfoList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user