gpt4 book ai didi

mysql - 在 vTiger 6.5 : Which table stores the products that belongs to a quotes?

转载 作者:太空宇宙 更新时间:2023-11-03 10:37:30 26 4
gpt4 key购买 nike

我需要知道哪个表作为中介来实现这些实体之间的多对多关系。

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

所以...

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 的真实姓名是什么?

最佳答案

vtiger_inventoryproductrelvtiger_quotesvtiger_products 之间的中间表

下面是 vtiger_inventoryproductrel 的结构,其中 id 列作为 QuotesOpportunity 的外键, 发票

enter image description here

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

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.

关于mysql - 在 vTiger 6.5 : Which table stores the products that belongs to a quotes?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45383511/

26 4 0