oilcode
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user