Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kuntashov/69fd8265999b391d4c2f36379af382cb to your computer and use it in GitHub Desktop.
Save kuntashov/69fd8265999b391d4c2f36379af382cb to your computer and use it in GitHub Desktop.
Удаление оффлайн-заказов, у которых ID_1C по ошибке не заполнилось на сайте
<?php
CModule::IncludeModule('sale');
$res = $DB->Query("select ID from b_sale_order where EXTERNAL_ORDER = 'Y' and ID_1C is null order by id ASC LIMIT 1000");
$count = 0;
while ($row = $res->Fetch()) {
CSaleOrder::Delete($row['ID']);
$count += 1;
}
echo "Deleted $count orders"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment