增加一个sturct
This commit is contained in:
@@ -100,9 +100,6 @@ type StoreSkuSyncInfo struct {
|
|||||||
SkuName string
|
SkuName string
|
||||||
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
|
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
|
||||||
StatusSaleEnd int16 `json:"statusSaleEnd"`
|
StatusSaleEnd int16 `json:"statusSaleEnd"`
|
||||||
JdSyncStatus int8 `orm:"default(2)"`
|
|
||||||
MtwmSyncStatus int8 `orm:"default(2)"`
|
|
||||||
EbaiSyncStatus int8 `orm:"default(2)"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MissingStoreSkuInfo struct {
|
type MissingStoreSkuInfo struct {
|
||||||
@@ -246,6 +243,13 @@ type StoreSkuPriceAndWeight struct {
|
|||||||
Price int
|
Price int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StoreSkuAndName struct {
|
||||||
|
StoreSkuSyncInfo
|
||||||
|
JdSyncStatus int8 `orm:"default(2)"`
|
||||||
|
MtwmSyncStatus int8 `orm:"default(2)"`
|
||||||
|
EbaiSyncStatus int8 `orm:"default(2)"`
|
||||||
|
}
|
||||||
|
|
||||||
// todo 应该通过需要同步的skuid来驱动同步分类,而不是当前这种分开的逻辑
|
// todo 应该通过需要同步的skuid来驱动同步分类,而不是当前这种分开的逻辑
|
||||||
// 单门店模式厂商适用
|
// 单门店模式厂商适用
|
||||||
// 从store_sku_bind中,得到所有依赖的商家分类信息
|
// 从store_sku_bind中,得到所有依赖的商家分类信息
|
||||||
@@ -1408,7 +1412,7 @@ func GetPriceReferPrice(db *DaoDB, cityCode int, skuID int, snapDate time.Time)
|
|||||||
return priceRefer, err
|
return priceRefer, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStoreSkusAndSkuName(db *DaoDB, storeIDs, skuIDs, nameIDs []int) (storeSkuSyncInfo []*StoreSkuSyncInfo, err error) {
|
func GetStoreSkusAndSkuName(db *DaoDB, storeIDs, skuIDs, nameIDs []int) (storeSkuAndName []*StoreSkuAndName, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT a.id bind_id, a.store_id, a.jd_sync_status, a.mtwm_sync_status, a.ebai_sync_status, a.unit_price, a.price,
|
SELECT a.id bind_id, a.store_id, a.jd_sync_status, a.mtwm_sync_status, a.ebai_sync_status, a.unit_price, a.price,
|
||||||
c.id name_id, c.unit, b.*
|
c.id name_id, c.unit, b.*
|
||||||
@@ -1434,6 +1438,6 @@ func GetStoreSkusAndSkuName(db *DaoDB, storeIDs, skuIDs, nameIDs []int) (storeSk
|
|||||||
sql += " AND b.name_id IN (" + GenQuestionMarks(len(nameIDs)) + ")"
|
sql += " AND b.name_id IN (" + GenQuestionMarks(len(nameIDs)) + ")"
|
||||||
sqlParams = append(sqlParams, nameIDs)
|
sqlParams = append(sqlParams, nameIDs)
|
||||||
}
|
}
|
||||||
err = GetRows(db, &storeSkuSyncInfo, sql, sqlParams...)
|
err = GetRows(db, &storeSkuAndName, sql, sqlParams...)
|
||||||
return storeSkuSyncInfo, err
|
return storeSkuAndName, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user