StoreSkuNameExt.Skus2改为Skus
This commit is contained in:
@@ -92,11 +92,10 @@ type StoreSkuNameExt struct {
|
||||
StoreName string `json:"storeName"`
|
||||
|
||||
model.SkuName
|
||||
PayPercentage int `json:"-"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
Skus []map[string]interface{} `orm:"-" json:"skus2,omitempty"`
|
||||
Skus2 []*StoreSkuExt `orm:"-" json:"skus,omitempty"`
|
||||
SkusStr string `json:"-"`
|
||||
PayPercentage int `json:"-"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
Skus []*StoreSkuExt `orm:"-" json:"skus,omitempty"`
|
||||
SkusStr string `json:"-"`
|
||||
|
||||
PendingOpType int8 `json:"pendingOpType"` // 取值同 StoreOpRequest.Type
|
||||
PendingUnitPrice int `json:"pendingUnitPrice"` // 这个是待审核的价格申请
|
||||
@@ -495,7 +494,7 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo
|
||||
} else {
|
||||
storeName = storeNameMap[index]
|
||||
}
|
||||
storeName.Skus2 = append(storeName.Skus2, &v.StoreSkuExt)
|
||||
storeName.Skus = append(storeName.Skus, &v.StoreSkuExt)
|
||||
}
|
||||
if err == nil {
|
||||
if isSaleInfo {
|
||||
@@ -524,7 +523,7 @@ func GetStoreAndSkuIDsFromInfo(skuNamesInfo *StoreSkuNamesInfo) (storeIDs, skuID
|
||||
skuIDMap := make(map[int]int)
|
||||
for _, skuName := range skuNamesInfo.SkuNames {
|
||||
storeIDMap[skuName.StoreID] = 1
|
||||
for _, sku := range skuName.Skus2 {
|
||||
for _, sku := range skuName.Skus {
|
||||
skuIDMap[sku.SkuID] = 1
|
||||
}
|
||||
}
|
||||
@@ -572,8 +571,8 @@ func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNa
|
||||
actStoreSkuMap4EarningPrice := jxutils.NewActStoreSkuMap(actStoreSkuList, false)
|
||||
|
||||
for _, skuName := range skuNamesInfo.SkuNames {
|
||||
if len(skuName.Skus2) > 0 {
|
||||
for _, v := range skuName.Skus2 {
|
||||
if len(skuName.Skus) > 0 {
|
||||
for _, v := range skuName.Skus {
|
||||
if actStoreSku := actStoreSkuMap4Act.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
|
||||
v.ActPrice = int(actStoreSku.ActualActPrice)
|
||||
v.ActID = actStoreSku.ActID
|
||||
@@ -628,7 +627,7 @@ func updateSaleInfo4StoreSkuName(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
var newSkuNames []*StoreSkuNameExt
|
||||
for _, skuName := range skuNamesInfo.SkuNames {
|
||||
var newSkus []*StoreSkuExt
|
||||
for _, sku := range skuName.Skus2 {
|
||||
for _, sku := range skuName.Skus {
|
||||
saleInfo := saleInfoMap[jxutils.Combine2Int(skuName.StoreID, sku.SkuID)]
|
||||
if saleInfo == nil && fromCount == 0 {
|
||||
saleInfo = &SkuSaleInfo{}
|
||||
@@ -640,7 +639,7 @@ func updateSaleInfo4StoreSkuName(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}
|
||||
}
|
||||
if len(newSkus) > 0 {
|
||||
skuName.Skus2 = newSkus
|
||||
skuName.Skus = newSkus
|
||||
newSkuNames = append(newSkuNames, skuName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user