|
@@ -10,11 +10,17 @@ export class CarService extends BaseService<modelType> {
|
|
|
@InjectEntityModel(Car)
|
|
|
model: modelType;
|
|
|
async queryList(filter) {
|
|
|
- const { skip = 0, limit, money, ...info } = filter;
|
|
|
+ const { skip = 0, limit, money, year, ...info } = filter;
|
|
|
// 处理价格
|
|
|
if (money) {
|
|
|
- const mon = money.substr(0, money.length - 1);
|
|
|
- info.total_money = { $gt: mon.match(/(\S*)-/)[1], $lt: mon.match(/-(\S*)/)[1] };
|
|
|
+ if (money.includes('下') !== -1) {
|
|
|
+ info.total_money = { $lt: money.match(/(\S*)万/)[1] };
|
|
|
+ } else if (money.includes('上') !== -1) {
|
|
|
+ info.total_money = { $gt: money.match(/(\S*)万/)[1] };
|
|
|
+ } else {
|
|
|
+ const mon = money.substr(0, money.length - 1);
|
|
|
+ info.total_money = { $gt: mon.match(/(\S*)-/)[1], $lt: mon.match(/-(\S*)/)[1] };
|
|
|
+ }
|
|
|
}
|
|
|
const pipes: any[] = [
|
|
|
{ $match: info },
|