Closed rowdyroad closed 7 years ago
Hi, again.
I've found this issue when working with ActiveRestController.
Index action makes count(*) query (for pagination). So, your component return an array not scalar int value.
Little Example: class Measuring extends \yii\db\ActiveRecord class MeasuringReport extends \kak\clickhouse\ActiveRecord
class Measuring extends \yii\db\ActiveRecord
class MeasuringReport extends \kak\clickhouse\ActiveRecord
var_dump(\app\models\Measuring::find()->count()); var_dump(\app\models\MeasuringReport::find()->count()); Response is:
var_dump(\app\models\Measuring::find()->count()); var_dump(\app\models\MeasuringReport::find()->count());
int(4308936) array(1) { [0]=> array(1) { ["COUNT()"]=> string(7) "4308936" } }
Now I'm thinking about way to fix it, we can think together))
Hi, yes this is error ( I don't use ActiveRecord, just DAO, but interested to fix it up
Tnx
без проблем ;)
Hi, again.
I've found this issue when working with ActiveRestController.
Index action makes count(*) query (for pagination). So, your component return an array not scalar int value.
Little Example:
class Measuring extends \yii\db\ActiveRecord
class MeasuringReport extends \kak\clickhouse\ActiveRecord
var_dump(\app\models\Measuring::find()->count()); var_dump(\app\models\MeasuringReport::find()->count());
Response is:Now I'm thinking about way to fix it, we can think together))