Hi, I am converting queryParams to queryStr but it says no table sql data found or array to string conversion. Please guide me how to get raw queries from paramquery arrays i have been getting.
protected function setup()
{
if (isset($this->params['query_params'])) {
$this->queryParams = ($this->params['query_params']);
}
$this->id = $this->params['id'] ?? '';
$this->name = $this->params['name'] ?? 'Visual';
$this->description = $this->params['description'] ?? '';
$params = \koolreport\core\Utility::get($this->queryParams, $this->name);
$qb = $this->paramsToQueryBuilder($params);
$this->queryStr = $params ? $qb->toMySQL() : "select * from users where 1=0";
$this->paramQuery = $params ? $qb->toMySQL(['useSQLParams' => "name"]) : "select * from users ";
$this->sqlParams = $qb->getSQLParams();
$this
->src('mysql')
->query($this->paramQuery)
->query($this->queryStr)
->params($this->sqlParams)
->pipe($this->dataStore('vqDS'));
}
Please guide me.
\koolreport\visualquery\VisualQuery::create(array(
"name" => $this->name,
"themeBase" => "bs4",
"schema" => "salesSchema",
"defaultValue" => [
"selectDistinct" => false,
"selectTables" => [
"users",
],
"filters" => [],
"limit" => [
"offset" => 5,
"limit" => 10,
"toggle" => false,
]
],
"queryParams" => $this->queryParams,
"queryStr" => $this->queryStr,
));
?>
Also I am not able to get this queryParams and queryStr in my controller. I am using in Laravel.