api - /api/v1/search/order - Sw 6.2.2 - 内部服务器错误
问题描述
我在 shopware 6.2.2 中使用 /api/v1/search/order Api。
这些是我的参数
{
"page":1,
"limit":10,
"filter":[
{
"type":"range",
"field":"orderDate",
"parameters":{
"gte":"2020-03-9"
}
}
],
"aggregations":[
{
"type":"histogram",
"name":"order_count_month",
"field":"orderDateTime",
"interval":"day",
"aggregation":{
"type":"sum",
"name":"amountTotal",
"field":"amountTotal"
}
}
]
}
我收到以下错误
{“错误”:[{“代码”:“0”,“状态”:“500”,“标题”:“内部服务器错误”,“详细信息”:“注意:未定义的索引:amountTotal”,“元”: {“跟踪”:[{“文件”:“/var/www/html/vendor/shopware/core/System/SalesChannel/Api/StructEncoder.php”,“行”:118,“函数”:“encodeStruct”, “类”:“Shopware\Core\System\SalesChannel\Api\StructEncoder”,“类型”:“->”,“args": [ { "key": "2020-04-29 00:00:00", "count": 1, "extensions": [], "amountTotal": { "sum": 19.99, "extensions": [] } }, 1, {} ] },[], "amountTotal": { "sum": 19.99, "extensions": [] } }, 1, {} ] },[], "amountTotal": { "sum": 19.99, "extensions": [] } }, 1, {} ] },
我怎样才能解决这个问题?
Shopware 仪表板中也存在此错误。因此 Shopware 6.2.2 仪表板中未显示销售、订单图表。
解决方案
您的 API 需要定义“totalAmount”,并且您没有传递它,请在文档或您的代码中检查该参数的预期位置。
推荐阅读
- html - HTML5 中具有 type="submit" 属性的标签列表
- django - 从 django-form 调用函数而不呈现其视图
- gnuplot - 使用标题列作为 y 轴的固定值
- python - 如何打开excel文件,将数据从数据框列写入列,另存为新文件
- julia - Julia 字符串插值后跟感叹号
- sonarqube - sonarqube 质量门 - 在“不支持的语言”上失败
- node.js - Node.JS MongoDB 发现:顺序比并行快,为什么?
- python - 在 FiPy 中使用扫描函数时的求解器容差和残差
- r - 如何使用 summaryCodings() 仅显示某个代码类别或多个代码的编码数量?
- notepad++ - 只有在 Notepad++ 中为 1 时才删除第一个数字