Last active
February 11, 2021 08:50
-
-
Save alexlcdee/761135ef078a24b24e959f5d22f710c2 to your computer and use it in GitHub Desktop.
batch query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$itemsPerRequest = 50; | |
$itemsCriteria = array( | |
'condition' => 't.type = 2 AND t.isDeleted != 1 AND t.isActive = 1 AND t.itemType = 1000', | |
'order' => 'id ASC', | |
'limit' => $itemsPerRequest, | |
'offset' => 0, | |
); | |
$i = 0; | |
echo 'Adding items list to xml', PHP_EOL; | |
while (count($items = Catalog::model()->findAll($itemsCriteria)) > 0) { | |
$yml = $this->insertYmlItems($yml, $items); | |
$itemsCriteria['offset'] += $itemsPerRequest; | |
//$i += $itemsPerRequest; | |
//if ($i > 100) break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment