|
@@ -24,11 +24,13 @@ export class CarController extends BaseController {
|
|
|
async query(@Query() filter) {
|
|
|
const result = await this.service.queryList(filter);
|
|
|
const data = [];
|
|
|
- for (const i of result[0].data) {
|
|
|
- const newData = new QVO_car(i);
|
|
|
- data.push(newData);
|
|
|
+ if (result[0].data.length > 0) {
|
|
|
+ for (const i of result[0].data) {
|
|
|
+ const newData = new QVO_car(i);
|
|
|
+ data.push(newData);
|
|
|
+ }
|
|
|
}
|
|
|
- const total = result[0].total;
|
|
|
+ const total = result[0].total || 0;
|
|
|
return { data, total };
|
|
|
}
|
|
|
|