How to concat 2 fields?
I saw this tip, but I didn't make it work:
Use
CONCAT("filialka_id", "city") or :CONCAT("filialka_id", "city") in one of the fields.
My code:
<?php
\GCore\Libs\GModel::generateModel("Drop", array('tablename' => "jri8z_chronoengine_chronoforms_datatable_concurso",));
$class = '\GCore\Models\Drop';
$data = $class::getInstance()->find('list', array('fields' => array('CONCAT(field1, field2) AS field3', 'field4'), "order" => array("created desc")));
$options = $data;
$field = array
(
'name' => 'fltr[field3][field4]',
'id' => '',
'options' =>
array (
),
'empty' => 'Select...',
'values' =>
array (
),
'label' =>
array (
'text' => '',
'position' => 'left',
),
'sublabel' => '',
'multiple' => '0',
'size' => '',
'class' => 'form-control',
'title' => 'Type',
'style' => '',
'params' => '',
':data-load-state' => '',
':data-tooltip' => '',
'type' => 'dropdown',
'container_id' => '0',
);
$field["options"] = $options;
echo \GCore\Helpers\Html::formLine($field["name"], $field);
?>