Commit 9e449996 by 杨树贤

Add IsZiying field and mark self-operated SKUs

Set IsZiying to 1 when supplierId == 17 and Canal is one of L0018319,
L0018562 or L0003270; default to 0 otherwise
parent fda608a7
Showing with 9 additions and 2 deletions
...@@ -102,8 +102,9 @@ type LySku struct { ...@@ -102,8 +102,9 @@ type LySku struct {
OnwayStock int `json:"onway_stock"` OnwayStock int `json:"onway_stock"`
CompareRatio float64 `json:"compare_ratio"` CompareRatio float64 `json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币 //兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost float64 `json:"cost"` Cost float64 `json:"cost"`
CostUs float64 `json:"cost_us"` CostUs float64 `json:"cost_us"`
IsZiying int `json:"is_ziying"`
} }
type DiscountRatio struct { type DiscountRatio struct {
...@@ -287,6 +288,12 @@ func InitSkuData(sku string) (data LySku) { ...@@ -287,6 +288,12 @@ func InitSkuData(sku string) (data LySku) {
data.Encoded = "10142-L" data.Encoded = "10142-L"
} }
//判断是否自营
data.IsZiying = 0
if supplierId == 17 && (data.Canal == "L0018319" || data.Canal == "L0018562" || data.Canal == "L0003270") {
data.IsZiying = 1
}
cpTime := gjson.Get(sku, "cp_time").Int() cpTime := gjson.Get(sku, "cp_time").Int()
data.CpTime = cpTime data.CpTime = cpTime
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment