门店价格
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
|
||||
db := dao.GetDB()
|
||||
if snapDate != "" {
|
||||
snapDateParam = utils.Str2Time(snapDate)
|
||||
}
|
||||
storeTotalScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, snapDateParam, offset, pageSize)
|
||||
storeTotalScoreEx = &model.StoreTotalScoreEx{
|
||||
StoreTotalScoreList: storeTotalScore,
|
||||
storePriceScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, snapDateParam, offset, pageSize)
|
||||
storePriceScoreEx = &dao.StorePriceScoreEx{
|
||||
StorePriceScoreList: storePriceScore,
|
||||
TotalCount: totalCount,
|
||||
}
|
||||
return storeTotalScoreEx, err
|
||||
return storePriceScoreEx, err
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ type CityBrankBranch struct {
|
||||
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) {
|
||||
return pricePercentage
|
||||
}
|
||||
@@ -463,7 +475,7 @@ func GetStoreMapsListWithoutDisabled(db *DaoDB, vendorIDs []int, status int) (st
|
||||
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 := `
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
t1.* FROM(
|
||||
@@ -494,8 +506,8 @@ func GetStorePriceScore(db *DaoDB, storeIDs []int, snapDate time.Time, offset, p
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(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)
|
||||
}
|
||||
return storeTotalScore, totalCount, err
|
||||
return StorePriceScore, totalCount, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user