|
@@ -10,7 +10,12 @@ export class CarService extends BaseService<modelType> {
|
|
|
@InjectEntityModel(Car)
|
|
|
model: modelType;
|
|
|
async queryList(filter) {
|
|
|
- const { skip = 0, limit, ...info } = filter;
|
|
|
+ const { skip = 0, limit, money, ...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] };
|
|
|
+ }
|
|
|
const pipes: any[] = [
|
|
|
{ $match: info },
|
|
|
{
|