1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
regionby.php
См. документацию.
1<?php
2
3namespace Bitrix\Landing\Update\Site;
4
5use Bitrix\Landing\Internals\SiteTable;
6use Bitrix\Landing\Rights;
7use Bitrix\Main\Application;
8use Bitrix\Main\ORM\Query\Query;
9use Bitrix\Main\Update\Stepper;
10
11class RegionBy extends Stepper
12{
13 public const STEP_LIMIT = 50;
14
15 protected static $moduleId = 'landing';
16
21 public function execute(array &$option): bool
22 {
23 $region = Application::getInstance()->getLicense()->getRegion();
24 if ($region !== 'by')
25 {
26 return false;
27 }
28
30 $steps = $option['steps'] ?? 0;
31 if (!isset($option['count']))
32 {
33 $siteCount = SiteTable::query()
34 ->addSelect(Query::expr()->count('ID'), 'CNT')
35 ->where('DELETED', '=', 'N')
36 ->where('LANG', '=', 'ru')
37 ->whereIn('TYPE', ['PAGE', 'STORE'])
38 ->exec()
39 ->fetch()
40 ;
41 $option['count'] = (int)$siteCount['CNT'];
42 }
43
44 $sites = SiteTable::query()
45 ->setSelect(['ID'])
46 ->where('DELETED', '=', 'N')
47 ->where('LANG', '=', 'ru')
48 ->whereIn('TYPE', ['PAGE', 'STORE'])
49 ->setLimit(self::STEP_LIMIT)
50 ->setOffset($steps)
51 ->exec()
52 ;
53 while($site = $sites->fetch())
54 {
55 SiteTable::update($site['ID'], [
56 'LANG' => 'by',
57 ]);
58 $steps++;
59 }
60
61 $option['steps'] = $steps;
63
64 return $option['steps'] !== $option['count'];
65 }
66}
static setGlobalOn()
Определения rights.php:116
static setGlobalOff()
Определения rights.php:107
execute(array &$option)
Определения regionby.php:21
$sites
Определения clear_component_cache.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$region
Определения .description.php:13
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
$siteCount
Определения options.php:69
$option
Определения options.php:1711
$site
Определения yandex_run.php:614