定时刷新商品可售状态

This commit is contained in:
苏尹岚
2019-11-15 11:58:53 +08:00
parent 744d28d36f
commit 4d013ad28b
8 changed files with 40 additions and 24 deletions

View File

@@ -84,8 +84,8 @@ type StoreSkuSyncInfo struct {
VendorPrice int64
MergedStatus int
SkuName string
StatusSaleBegin int `json:"statusSaleBegin"` //商品可售时间范围
StatusSaleEnd int `json:"statusSaleEnd"`
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
StatusSaleEnd int16 `json:"statusSaleEnd"`
}
type MissingStoreSkuInfo struct {
@@ -589,7 +589,7 @@ func (s *StoreSkuSyncInfo) GetSeq() int {
return int(s.VendorPrice)
}
func GetStoresSkusInfoBySaleTime(db *DaoDB) (storeSkuBindList []*model.StoreSkuBind, err error) {
func GetStoresSkusInfoBySaleTime(db *DaoDB, storeID int) (storeSkuBindList []*model.StoreSkuBind, err error) {
sql := `
SELECT t1.*
FROM store_sku_bind t1
@@ -601,6 +601,10 @@ func GetStoresSkusInfoBySaleTime(db *DaoDB) (storeSkuBindList []*model.StoreSkuB
model.SkuStatusNormal,
utils.DefaultTimeValue,
}
if storeID > 0 {
sql += ` AND t1.store_id = ?`
sqlParams = append(sqlParams, storeID)
}
err = GetRows(db, &storeSkuBindList, sql, sqlParams...)
return storeSkuBindList, err
}