magento 2

时间:2016-09-05 10:00:58

标签: magento magento2

这是我第一次发帖,所以我希望我提供足够的细节。我正在尝试使用各自的标签检索所有产品属性。 使用:V1 / products / attributes?searchCriteria [filter_groups] [0] [filters] [0] [field] = attribute_code& searchCriteria [filter_groups] [0] [filters] [0] [value] = {attrCode}& searchCriteria [filter_groups] [0] [过滤器] [0] [condition_type] =当量

如果我尝试,我可以检索特定属性代码的特定ID:

V1 /产品/属性searchCriteria [filter_groups] [0] [过滤器] [0] [字段] = entity_type_id&安培; searchCriteria [filter_groups] [0] [过滤器] [0] [值] = {entity_type_id}&安培; searchCriteria [filter_groups] [0] [过滤器] [0] [condition_type] =当量

我收到以下错误: 生成的输出: iwwshr.Exceptions.WebServiceCallFailedException:远程服务器返回错误:(500)内部服务器错误。 ProtocolError http://VMDP-200CRM2011:8081/magento/rest/default/V1/products/attributes?searchCriteria[filter_groups][0][filters][0][field]=entity_type_id&searchCriteria[filter_groups][0][filters][0][value]=4&searchCriteria[filter_groups][0][filters][0][condition_type]=eq Web服务器返回: {" message":"内部错误。 Magento日志文件中提供了详细信息。报告编号:webapi-57cd41117122e"}    在Tool.Classes.Runtime.HttpOperationWrapper.DoCall()    在Tool.Classes.Runtime.HttpOperationWrapper.DoSampleCall(String xmlCallData)

转到我收到的日志: 报告编号:webapi-57cd41117122e;消息:SQLSTATE [23000]:完整性约束违规:1052列' entity_type_id'在where子句不明确的情况下,查询为:SELECT COUNT(DISTINCT main_table.attribute_id)FROM eav_attribute AS main_table  INNER JOIN eav_entity_type AS entity_type ON main_table.entity_type_id = entity_type.entity_type_id  INNER JOIN eav_entity_attribute ON main_table.attribute_id = eav_entity_attribute.attribute_id  INNER JOIN catalog_eav_attribute AS additional_table ON main_table.attribute_id = additional_table.attribute_id WHERE(entity_type_code =' catalog_product')AND(entity_type_id =' 4')'在C:\ wamp64 \ www \ magento \ vendor \ magento \ framework \ Webapi \ ErrorProcessor.php:194

正在运行的查询是: SELECT COUNT(DISTINCT main_table.attribute_id)FROM eav_attribute AS main_table  INNER JOIN eav_entity_type AS entity_type ON main_table.entity_type_id = entity_type.entity_type_id  INNER JOIN eav_entity_attribute ON main_table.attribute_id = eav_entity_attribute.attribute_id  INNER JOIN catalog_eav_attribute AS additional_table ON main_table.attribute_id = additional_table.attribute_id WHERE(entity_type_code =' catalog_product')AND(entity_type_id =' 4&#39)

返回: 错误代码:1052。列' entity_type_id' in where子句不明确

如果我将查询更改为: SELECT COUNT(DISTINCT main_table.attribute_id)FROM eav_attribute AS main_table  INNER JOIN eav_entity_type AS entity_type ON main_table.entity_type_id = entity_type.entity_type_id  INNER JOIN eav_entity_attribute ON main_table.attribute_id = eav_entity_attribute.attribute_id  INNER JOIN catalog_eav_attribute AS additional_table ON main_table.attribute_id = additional_table.attribute_id WHERE(entity_type_code =' catalog_product')AND( main_table entity_type_id =' 4')

返回一行。

也许我做错了什么,但我不确定如何检索所有产品属性???

0 个答案:

没有答案