Skip to content

Commit

Permalink
修复实时索引信息过滤不准确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
libinqi committed Jan 23, 2015
1 parent 8d53b5c commit e119a97
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
8 changes: 8 additions & 0 deletions app/client/rabbit-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,17 @@ module.exports = function (app) {
if (line.flightinfo && line.flightinfo != '其他') {
lineModel.transRateDay = line.flightinfo.substring(0, 1);
}
else
{
lineModel.transRateDay=0;
}
if (line.flightinfo && line.flightinfo != '其他') {
lineModel.transRateNumber = line.flightinfo.substring(2, 3);
}
else
{
lineModel.transRateNumber=0;
}
if (line.contactaddr) {
lineModel.startAddress = line.contactaddr;
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = {
if (model.filter.ctype) {
info_dict.car_type.forEach(function (item, index) {
if (item.id == model.filter.ctype) {
cl.SetFilterString('vehicleType', item.name);
cl.SetFilterString('vehicleType', item.name,true);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/goods.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module.exports = {
if (model.filter.gtype) {
info_dict.goods_type.forEach(function (item, index) {
if (item.id == model.filter.gtype) {
cl.SetFilterString('goodsType', item.name);
cl.SetFilterString('goodsType', item.name,true);
}
});
}
Expand Down
13 changes: 6 additions & 7 deletions app/controllers/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ module.exports = {
cl.SetSortMode(4, model.sort.filed + ' ' + model.sort.sorttype);

if (model.filter.transrate) {
if (model.filter.transrate == 1) {
cl.SetFilter('transRate', [0]);
}
else {
cl.SetFilter('transRate', [1]);
cl.SetFilter('transRateDay', [model.filter.transrate - 1]);
}
info_dict.trans_rate.forEach(function (item, index) {
if (item.id == model.filter.transrate) {
cl.SetFilter('transRateDay', [item.value[0]]);
cl.SetFilter('transRateNumber', [item.value[1]]);
}
});
}
if (model.filter.transtime) {
cl.SetFilter('transTime', [model.filter.transtime]);
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ module.exports = {
cl.SetSortMode(4, model.sort.filed + ' ' + model.sort.sorttype);

if (model.filter.businessscope) {
cl.SetFilter('businessScopeCode', [model.filter.businessscope]);
info_dict.business_scope.forEach(function (item, index) {
if (item.id == model.filter.businessscope) {
cl.SetFilterString('businessScope', item.name);
}
});
}
if (model.filter.storetype) {
cl.SetFilter('storeTypeCode', [model.filter.storetype]);
Expand Down
14 changes: 7 additions & 7 deletions lib/info_dict.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ exports.info_dict = {

//发车班次
trans_rate: [
{"id": "1", "name": "每隔1天一班"},
{"id": "2", "name": "每隔1天二班"},
{"id": "3", "name": "每隔1天三班"},
{"id": "4", "name": "每隔2天一班"},
{"id": "5", "name": "每隔3天一班"},
{"id": "6", "name": "每隔5天一班"},
{"id": "7", "name": "其它"}
{"id": "1", "name": "每隔1天一班", value: [1, 1]},
{"id": "2", "name": "每隔1天二班", value: [1, 2]},
{"id": "3", "name": "每隔1天三班", value: [1, 3]},
{"id": "4", "name": "每隔2天一班", value: [2, 1]},
{"id": "5", "name": "每隔3天一班", value: [3, 1]},
{"id": "6", "name": "每隔5天一班", value: [4, 1]},
{"id": "7", "name": "其它", value: [0, 0]}
],

//在途时间
Expand Down

0 comments on commit e119a97

Please sign in to comment.