我设计了一个视图,并在预览部分看到了此查询:
SELECT node.nid AS nid,
node_data_field_crm_history_brokerid.field_crm_history_brokerid_value AS node_data_field_crm_history_brokerid_field_crm_history_brokerid_value,
node.language AS node_language,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_crm_history_brokerid.field_crm_history_caseid_value AS node_data_field_crm_history_brokerid_field_crm_history_caseid_value,
node_data_field_crm_history_brokerid.field_crm_history_dateadded_value AS node_data_field_crm_history_brokerid_field_crm_history_dateadded_value,
node_data_field_crm_history_brokerid.field_crm_history_entrydesc_value AS node_data_field_crm_history_brokerid_field_crm_history_entrydesc_value
FROM node node
LEFT JOIN content_type_crm_history node_data_field_crm_history_brokerid ON node.vid = node_data_field_crm_history_brokerid.vid
WHERE node.type in ('crm_history')
这vid
是什么意思?
实际上,我需要这样做,因为当我尝试使用以下查询尝试在crm_history中插入一条简单规则来插入一行时:
$result = db_query("INSERT INTO {content_type_crm_history} (vid, nid, field_crm_history_caseid_value, field_crm_history_brokerid_value, field_crm_history_dateadded_value, field_crm_history_entrydesc_value) VALUES (" . $node->nid . ", " . $node->vid . ", " . $caseid . ", " . $brokerid . ", " . $dateadded . ", '" . t($entrydesc) . "')");
它确实填充了数据库表,但未在视图中显示。当我通过创建内容页面添加时,它仅显示视图。