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