定时修改商品可售状态
This commit is contained in:
@@ -107,6 +107,14 @@ type StoreSkuNameInfo struct {
|
||||
UnitPrice int64
|
||||
}
|
||||
|
||||
type StoreSkuBindWithSaleTime struct {
|
||||
StoreSkuBind model.StoreSkuBind
|
||||
TimeBegin1 int
|
||||
TimeEnd1 int
|
||||
TimeBegin2 int
|
||||
TimeEnd2 int
|
||||
}
|
||||
|
||||
// todo 应该通过需要同步的skuid来驱动同步分类,而不是当前这种分开的逻辑
|
||||
// 单门店模式厂商适用
|
||||
// 从store_sku_bind中,得到所有依赖的商家分类信息
|
||||
@@ -584,3 +592,22 @@ func (s *StoreSkuSyncInfo) GetSeq() int {
|
||||
}
|
||||
return int(s.VendorPrice)
|
||||
}
|
||||
|
||||
func GetStoresSkusInfoBySaleTime(db *DaoDB) (storeSkuBindList []*StoreSkuBindWithSaleTime, err error) {
|
||||
sql := `
|
||||
SELECT t1.*,
|
||||
IF(t2.open_time1 <= t1.status_sale_begin,t2.open_time1,0) time_begin1,
|
||||
IF(t2.open_time1 <= t1.status_sale_begin,t1.status_sale_begin,0) time_end1,
|
||||
IF(t2.close_time1 >= t1.status_sale_end,t1.status_sale_end,0) time_begin2,
|
||||
IF(t2.close_time1 >= t1.status_sale_end,t2.close_time1,0) time_end2
|
||||
FROM store_sku_bind t1
|
||||
JOIN store t2 ON t1.store_id = t2.id
|
||||
WHERE t1.status_sale_begin <> 0 AND t1.status_sale_end <> 0
|
||||
AND t1.status != ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
model.SkuStatusDeleted,
|
||||
}
|
||||
err = GetRows(db, &storeSkuBindList, sql, sqlParams...)
|
||||
return storeSkuBindList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user