Ich habe in dieser Ausgabe der letzten zwei Tage festgefahren.Abfrage Filter zuweisen Unterabfrage zu einem Feld Wert
Bitte helfen.
Ich möchte die folgende Abfrage zuweisen.
$qr = "(select subconfigcode.field_subconfigcode_value AS configcode FROM node node LEFT JOIN field_data_field_select_parent_configuratio select_parent_configuratio ON node.nid = select_parent_configuratio.entity_id AND (select_parent_configuratio.entity_type = node AND select_parent_configuratio.deleted = 0) LEFT JOIN node select_parent_configuratio_node ON select_parent_configuratio.field_select_parent_configuratio_nid = select_parent_configuratio_node.nid LEFT JOIN field_data_field_subconfigcode subconfigcode ON select_parent_configuratio_node.nid = subconfigcode.entity_id AND (subconfigcode.entity_type = 'node' AND subconfigcode.deleted = '0') WHERE (((select_parent_configuratio.field_select_parent_configuratio_nid = node_field_data_field_select_parent_configuratio.nid))AND(((node.status = '1') AND (node.type IN ('offering'))))) ORDER BY node.created DESC, configcode ASC LIMIT 1 OFFSET 0)";
zu
ein Feldwert Sicht.
Ich habe den folgenden Code verwendet.
function general_views_query_alter(&$view, &$query) {
$qr = " (select subconfigcode.field_subconfigcode_value AS configcode FROM node node LEFT JOIN field_data_field_select_parent_configuratio select_parent_configuratio ON node.nid = select_parent_configuratio.entity_id AND (select_parent_configuratio.entity_type = node AND select_parent_configuratio.deleted = 0) LEFT JOIN node select_parent_configuratio_node ON select_parent_configuratio.field_select_parent_configuratio_nid = select_parent_configuratio_node.nid LEFT JOIN field_data_field_subconfigcode subconfigcode ON select_parent_configuratio_node.nid = subconfigcode.entity_id AND (subconfigcode.entity_type = 'node' AND subconfigcode.deleted = '0') WHERE (((select_parent_configuratio.field_select_parent_configuratio_nid = node_field_data_field_select_parent_configuratio.nid))AND(((node.status = '1') AND (node.type IN ('offering'))))) ORDER BY node.created DESC, configcode ASC LIMIT 1 OFFSET 0)";
$query->add_where(1, "node_field_data_field_select_parent_configuratio__field_data_field_subconfigcode.field_subconfigcode_value", $qr);
}
Aber es gibt folgende Abfrage zurück.
where node_field_data_field_select_parent_configuratio__field_data_field_subconfigcode.field_subconfigcode_value = '(select subconfigcode.field_subconfigcode_value AS configcode FROM node node LEFT JOIN field_data_field_select_parent_configuratio select_parent_configuratio ON node.nid = select_parent_configuratio.entity_id AND (select_parent_configuratio.entity_type = node AND select_parent_configuratio.deleted = 0) LEFT JOIN node select_parent_configuratio_node ON select_parent_configuratio.field_select_parent_configuratio_nid = select_parent_configuratio_node.nid LEFT JOIN field_data_field_subconfigcode subconfigcode ON select_parent_configuratio_node.nid = subconfigcode.entity_id AND (subconfigcode.entity_type = \'node\' AND subconfigcode.deleted = \'0\') WHERE (((select_parent_configuratio.field_select_parent_configuratio_nid = node_field_data_field_select_parent_configuratio.nid))AND(((node.status = \'1\') AND (node.type IN (\'offering\'))))) ORDER BY node.created DESC, configcode ASC LIMIT 1 OFFSET 0) ')
Ich möchte Abfrage erhalten, ohne das Apostroph für Sub-Abfrage zugeordnet und entfernen Sie zusätzliche jedem Wert aufgeschlitzt hinzugefügt.
Bitte helfen.