我使用 Drupal 7 和 Ubercart 3 开发了一个音乐商店,我正在使用 JasperReports ( iReport )建立报告。我正在检索属于某个节点的taxonomy_index表中包含的多个Taxonomy术语,因此我可以在报告中显示。
例如,节点id 13有3个术语。
我的挑战是我当前的查询只显示一个术语。您可以帮助我查询以显示更多条款。
SELECT
taxonomy_term_data.`name` AS taxonomy_term_data_name,
taxonomy_vocabulary.`name` AS taxonomy_vocabulary_name,
uc_order_products.`qty` AS uc_order_products_qty,
uc_order_products.`price` AS uc_order_products_price,
node.`type` AS node_type,
node.`title` AS node_title,
uc_orders.`created` AS uc_orders_created
FROM
`uc_order_products` uc_order_products INNER JOIN `node` node ON uc_order_products.`nid` = node.`nid`
INNER JOIN `taxonomy_index` taxonomy_index ON node.`nid` = taxonomy_index.`nid`
INNER JOIN `taxonomy_term_data` taxonomy_term_data ON taxonomy_index.`tid` = taxonomy_term_data.`tid`
INNER JOIN `taxonomy_vocabulary` taxonomy_vocabulary ON taxonomy_term_data.`vid` = taxonomy_vocabulary.`vid`
INNER JOIN `uc_orders` uc_orders ON uc_order_products.`order_id` = uc_orders.`order_id`
WHERE
taxonomy_term_data.`tid` = 11