This commit is contained in:
苏尹岚
2020-12-02 18:10:22 +08:00
parent 8fcd186ed3
commit 3405090597
3 changed files with 9 additions and 4 deletions

View File

@@ -423,7 +423,7 @@ func GetStationList(db *DaoDB) (stations []*model.StationInfo, err error) {
return stations, err
}
func GetStationInfoList(db *DaoDB, stationName string, cityCode int, lat, lng float64, sortType, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
func GetStationInfoList(db *DaoDB, stationName string, cityCode int, lat, lng float64, oilCode string, sortType, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
var (
stations []*model.StationInfo
distanceFlag bool
@@ -451,6 +451,10 @@ func GetStationInfoList(db *DaoDB, stationName string, cityCode int, lat, lng fl
sql += " AND city_id = ?"
sqlParams = append(sqlParams, cityCode)
}
if oilCode != "" {
sql += " AND POSITION(oilCode IN prices) > 0"
sqlParams = append(sqlParams, oilCode)
}
if sortType != 0 {
if sortType == 1 {
sql += " ORDER BY distance"