门店价格
This commit is contained in:
@@ -2413,16 +2413,16 @@ func StoreStatus2Chinese(status int) (str string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, snapDate string, offset, pageSize int) (storeTotalScoreEx *model.StoreTotalScoreEx, err error) {
|
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, snapDate string, offset, pageSize int) (storePriceScoreEx *dao.StorePriceScoreEx, err error) {
|
||||||
var snapDateParam time.Time
|
var snapDateParam time.Time
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if snapDate != "" {
|
if snapDate != "" {
|
||||||
snapDateParam = utils.Str2Time(snapDate)
|
snapDateParam = utils.Str2Time(snapDate)
|
||||||
}
|
}
|
||||||
storeTotalScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, snapDateParam, offset, pageSize)
|
storePriceScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, snapDateParam, offset, pageSize)
|
||||||
storeTotalScoreEx = &model.StoreTotalScoreEx{
|
storePriceScoreEx = &dao.StorePriceScoreEx{
|
||||||
StoreTotalScoreList: storeTotalScore,
|
StorePriceScoreList: storePriceScore,
|
||||||
TotalCount: totalCount,
|
TotalCount: totalCount,
|
||||||
}
|
}
|
||||||
return storeTotalScoreEx, err
|
return storePriceScoreEx, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,18 @@ type CityBrankBranch struct {
|
|||||||
PayeeBankCode string `orm:"size(8)" json:"payeeBankCode"` // 开户行代码
|
PayeeBankCode string `orm:"size(8)" json:"payeeBankCode"` // 开户行代码
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StorePriceScore struct {
|
||||||
|
StoreID int `json:"storeID"`
|
||||||
|
StoreName string `json:"storeName"`
|
||||||
|
StoreScore float64 `json:"storeScore"`
|
||||||
|
CityName string `json:"cityName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type StorePriceScoreEx struct {
|
||||||
|
StorePriceScoreList []*StorePriceScore `json:"storePriceScoreList"`
|
||||||
|
TotalCount int `json:"totalCount"`
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
|
func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
|
||||||
return pricePercentage
|
return pricePercentage
|
||||||
}
|
}
|
||||||
@@ -463,7 +475,7 @@ func GetStoreMapsListWithoutDisabled(db *DaoDB, vendorIDs []int, status int) (st
|
|||||||
return storeMapList, err
|
return storeMapList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStorePriceScore(db *DaoDB, storeIDs []int, snapDate time.Time, offset, pageSize int) (storeTotalScore []*model.StoreTotalScore, totalCount int, err error) {
|
func GetStorePriceScore(db *DaoDB, storeIDs []int, snapDate time.Time, offset, pageSize int) (StorePriceScore []*StorePriceScore, totalCount int, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
SELECT SQL_CALC_FOUND_ROWS
|
||||||
t1.* FROM(
|
t1.* FROM(
|
||||||
@@ -494,8 +506,8 @@ func GetStorePriceScore(db *DaoDB, storeIDs []int, snapDate time.Time, offset, p
|
|||||||
sqlParams = append(sqlParams, pageSize, offset)
|
sqlParams = append(sqlParams, pageSize, offset)
|
||||||
Begin(db)
|
Begin(db)
|
||||||
defer Commit(db)
|
defer Commit(db)
|
||||||
if err = GetRows(db, &storeTotalScore, sql, sqlParams...); err == nil {
|
if err = GetRows(db, &StorePriceScore, sql, sqlParams...); err == nil {
|
||||||
totalCount = GetLastTotalRowCount(db)
|
totalCount = GetLastTotalRowCount(db)
|
||||||
}
|
}
|
||||||
return storeTotalScore, totalCount, err
|
return StorePriceScore, totalCount, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user