价格统计

This commit is contained in:
苏尹岚
2019-12-09 09:31:34 +08:00
parent 441fa5e3d8
commit 5d1f128e1d
4 changed files with 35 additions and 15 deletions

View File

@@ -2413,18 +2413,18 @@ func StoreStatus2Chinese(status int) (str string) {
}
}
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, fromScore, toScore, sort int, snapDate string, offset, pageSize int) (storePriceScoreEx *dao.StorePriceScoreEx, err error) {
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, fromScore, toScore, sort int, snapDate string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
var snapDateParam time.Time
db := dao.GetDB()
if snapDate != "" {
snapDateParam = utils.Str2Time(snapDate)
}
storePriceScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, fromScore, toScore, sort, snapDateParam, offset, pageSize)
storePriceScoreEx = &dao.StorePriceScoreEx{
StorePriceScoreList: storePriceScore,
TotalCount: totalCount,
pagedInfo = &model.PagedInfo{
Data: storePriceScore,
TotalCount: totalCount,
}
return storePriceScoreEx, err
return pagedInfo, err
}
func CreateStorePriceScore(ctx *jxcontext.Context) (err error) {

View File

@@ -36,9 +36,18 @@ func GetStatisticsReportForAfsOrders(ctx *jxcontext.Context, storeIDs []int, fro
return statisticsReportForOrdersList, err
}
func StatisticsReportForStoreSkusPrice(ctx *jxcontext.Context, cityCodes, skuIDs []int) (priceRefer []*model.PriceReferSnapshot, err error) {
func StatisticsReportForStoreSkusPrice(ctx *jxcontext.Context, cityCodes, skuIDs []int, snapDate string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
var snapDateParam time.Time
db := dao.GetDB()
return dao.GetPriceReferSnapshot(db, cityCodes, skuIDs)
if snapDate != "" {
snapDateParam = utils.Str2Time(snapDate)
}
priceReferSnapshot, totalCount, err := dao.GetPriceReferSnapshot(db, cityCodes, skuIDs, snapDateParam, offset, pageSize)
pagedInfo = &model.PagedInfo{
Data: priceReferSnapshot,
TotalCount: totalCount,
}
return
}
func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int) (err error) {