aa
This commit is contained in:
@@ -2331,6 +2331,7 @@ func ExportOrderWithSku(ctx *jxcontext.Context, orders []*model.GoodsOrderExt) (
|
||||
EarningPriceSku float64 `json:"商品结算"`
|
||||
Upc string `json:"条形码"`
|
||||
IsAfs int `json:"是否已售后"`
|
||||
AfsCount int `json:"售后数量"`
|
||||
}
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
@@ -2348,6 +2349,7 @@ func ExportOrderWithSku(ctx *jxcontext.Context, orders []*model.GoodsOrderExt) (
|
||||
"商品结算",
|
||||
"条形码",
|
||||
"是否已售后",
|
||||
"售后数量",
|
||||
}
|
||||
vendorOrderIDs []string
|
||||
results []*ExportOrderWithSkuExt
|
||||
@@ -2356,10 +2358,11 @@ func ExportOrderWithSku(ctx *jxcontext.Context, orders []*model.GoodsOrderExt) (
|
||||
vendorOrderIDs = append(vendorOrderIDs, v.VendorOrderID)
|
||||
}
|
||||
sql := `
|
||||
SELECT IF(a.vendor_id = 0, '京东',IF(a.vendor_id = 1, '美团',IF(a.vendor_id = 3, '饿百','不明'))) vendor_name, a.order_created_at, a.vendor_order_id,
|
||||
IF(b.earning_type = 1, b.earning_price, b.total_shop_money * (100-b.order_pay_percentage/2)/100) /100 earning_price,
|
||||
SELECT IF(a.vendor_id = 0, '京东',IF(a.vendor_id = 1, '美团',IF(a.vendor_id = 3, '饿百','不明'))) vendor_name,
|
||||
DATE_FORMAT(a.order_created_at,'%Y-%m-%d %h:%i:%s') order_created_at,
|
||||
a.vendor_order_id, IF(b.earning_type = 1, b.earning_price, b.total_shop_money * (100-b.order_pay_percentage/2)/100) /100 earning_price,
|
||||
a.shop_price /100 shop_price, a.count, IF(b.earning_type = 1, a.earning_price, 0) /100 earning_price_sku, a.sku_name, d.upc,
|
||||
e.name store_name, f.name category_name_fst, g.name category_name_snd, IF(h.id IS NULL, 0, 1) is_afs
|
||||
e.name store_name, f.name category_name_fst, g.name category_name_snd, IF(h.id IS NULL, 0, 1) is_afs, h.count afs_count
|
||||
FROM order_sku a
|
||||
LEFT JOIN goods_order b ON a.vendor_order_id = b.vendor_order_id
|
||||
LEFT JOIN sku c ON c.id = a.sku_id
|
||||
@@ -2372,8 +2375,6 @@ func ExportOrderWithSku(ctx *jxcontext.Context, orders []*model.GoodsOrderExt) (
|
||||
ORDER BY store_name, order_created_at DESC
|
||||
`
|
||||
sqlParams := []interface{}{model.YES, vendorOrderIDs}
|
||||
fmt.Println(sql)
|
||||
fmt.Println(sqlParams)
|
||||
err = dao.GetRows(db, &results, sql, sqlParams)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user