0

我正在使用续集。

const total = await models.parcel.findAndCountAll({ group: ['status'] });

我得到了这个回应。
但我只想不计算响应行。
我怎样才能做到这一点?非常感谢您阅读我的问题。

{
    "count": [
        {
            "status": null,
            "count": 8
        },
        {
            "status": "1",
            "count": 5
        },
        {
            "status": "2",
            "count": 3
        }
    ],
    "rows": [
        {
            "id": 3,
            "companyName": "hy",
            "invoice": "904103",
            "receiverName": "Rtrt",

        },......
     ]
 }
4

1 回答 1

1

只需更改findAndCountAllcount

await models.parcel.findAndCountAll({ group: ['status'] });

到 :

await models.parcel.count({ group: ['status'] });
于 2019-08-22T07:32:33.500 回答