- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
$db=Yii::$app->db;
if($db->driverName == 'pgsql') {
$sql ="select a.* from report a inner join code_report b on a.id=b.report_id ";
$sql.=" inner join code c on b.code_id=c.id where cast (c.val as integer ) {$znaki[$sign]} $value group by a.id";//pgsql
}
if($db->driverName == 'mysql') {
$sql ="select a.* from report a inner join code_report b on a.id=b.report_id ";
$sql.=" inner join code c on b.code_id=c.id where convert(c.val, signed) {$znaki[$sign]} $value group by a.id";//mysql
}