在 vTiger 6.5 中:哪个 table 存储属于报价的产品?

In vTiger 6.5: Which table stores the products that belongs to a quotes?

我需要知道哪个table充当中介来实现这些实体之间的多对多关系。

我知道存储产品的 table 是 vtiger_products 而保留引号的是 vtiger_quotes 但我不知道 table 与哪个相关两者都有,所以我的查询不完整。

所以...

SELECT * FROM vtiger_quotes
INNER JOIN vtiger_products INNER JOIN table_relates_both
ON vtiger_quotes.quoteid = table_relates_both.quoteid
AND vtiger_products.productid = table_relates_both.productid
WHERE vtiger_quotes.potentialid = ?

table_relates_both的真名是什么?

table 名字是 vtiger_inventoryproductrel

vtiger_inventoryproductrelvtiger_quotesvtiger_products

之间的中介 table

下面是 vtiger_inventoryproductrel 的结构,其中 id 列充当 QuotesOpportunityInvoice 等的外键

如果您想获取与特定机会相关的报价,则需要执行以下查询:

SELECT {your required field goes here} FROM vtiger_inventoryproductrel INNER JOIN vtiger_quotes 
    ON vtiger_quotes.quoteid = vtiger_inventoryproductrel.id 
    WHERE vtiger_quotes.potentialid = $potential_id

另请注意:

vtiger_crmentity - This is core table in which an entry is added for all entity type records. This stores meta information like record id, record owner id, last modified by user id, created time, modified time and description.