Answer the question
In order to leave comments, you need to log in
How to get all the data from a request?
I make a request
Goods::find()
->joinWith('addfeilds')
->where(['have'=>self::HAVE])
->andWhere(['or',['key_feild'=>'color'],['key_feild'=>'size1']])
->orderBy(['id'=>SORT_ASC])
->limit(10);
$count=1;
foreach ($query->each(100) as $model) {
echo $count;
$count++;
}
SELECT `abh_gods`.* FROM `abh_gods` LEFT JOIN `abh_addlfeild` ON `abh_gods`.`id` = `abh_addlfeild`.`id_gods` WHERE (`have`=0) AND ((`key_feild`='color') OR (`key_feild`='size1')) ORDER BY `id` LIMIT 10
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question