if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
+ // Разрешённые IP для debug/gii: через ENV или только localhost
+ $debugAllowedIPs = getenv('DEBUG_ALLOWED_IPS')
+ ? explode(',', getenv('DEBUG_ALLOWED_IPS'))
+ : ['127.0.0.1', '::1'];
+
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['*'],
+ 'allowedIPs' => $debugAllowedIPs,
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['*'],
+ 'allowedIPs' => $debugAllowedIPs,
];
}
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
+ // Разрешённые IP для debug/gii: через ENV или только localhost
+ $debugAllowedIPs = getenv('DEBUG_ALLOWED_IPS')
+ ? explode(',', getenv('DEBUG_ALLOWED_IPS'))
+ : ['127.0.0.1', '::1'];
+
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['*'],
+ 'allowedIPs' => $debugAllowedIPs,
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['*'],
+ 'allowedIPs' => $debugAllowedIPs,
];
/**
* Статус в РМК/1С (человекочитаемый)
*/
- public ?string $rmkStatus;
+ public ?string $rmkStatus = null;
/**
* Код статуса РМК/1С
*/
- public ?string $rmkStatusId;
+ public ?string $rmkStatusId = null;
/**
* Статус в МП (человекочитаемый)
*/
- public ?string $mpStatus;
+ public ?string $mpStatus = null;
/**
* Код статуса МП
*/
- public ?string $mpStatusCode;
+ public ?string $mpStatusCode = null;
/**
* Код субстатуса МП
*/
- public ?string $mpSubstatusCode;
+ public ?string $mpSubstatusCode = null;
/**
* ID заказа в БД
/**
* ID магазина
*/
- public ?int $storeId;
+ public ?int $storeId = null;
/**
* Название магазина
*/
- public ?string $storeName;
+ public ?string $storeName = null;
/**
* Название маркетплейса
*/
- public ?string $marketplaceName;
+ public ?string $marketplaceName = null;
/**
* ID маркетплейса (1 - Flowwow, 2 - YandexMarket)
*/
- public ?int $marketplaceId;
+ public ?int $marketplaceId = null;
/**
* Сумма заказа
/**
* Дата создания заказа
*/
- public ?string $creationDate;
+ public ?string $creationDate = null;
/**
* ID продавца (seller_id)
*/
- public ?string $sellerId;
+ public ?string $sellerId = null;
/**
* GUID чека заказа (check_guid из marketplace_orders)
*/
- public ?string $checkGuid;
+ public ?string $checkGuid = null;
/**
* Существует ли чек в create_checks
/**
* Причина проблемы (no_seller_id, no_check, no_check_guid, no_seller_and_check_guid)
*/
- public ?string $issueReason;
+ public ?string $issueReason = null;
/**
* Человекочитаемые метки причин
$this->assertStringContainsString('Завис в доставке', $message);
$this->assertStringContainsString('Успех без чека', $message);
- // Проверяем наличие номеров заказов
- $this->assertStringContainsString('FW-100', $message);
- $this->assertStringContainsString('YM-200', $message);
+ // Проверяем наличие номеров заказов (в MarkdownV2 дефис экранируется)
+ $this->assertStringContainsString('FW\-100', $message);
+ $this->assertStringContainsString('YM\-200', $message);
// Проверяем наличие итога
$this->assertStringContainsString('Всего:', $message);
$message = $this->service->formatTelegramControlReport($result);
- // Ð\9fÑ\80овеÑ\80Ñ\8fем налиÑ\87ие моноÑ\88иÑ\80инного блока
- $this->assertStringContainsString('```', $message);
+ // Ð\9fÑ\80овеÑ\80Ñ\8fем налиÑ\87ие номеÑ\80а заказа в MarkdownV2 Ñ\84оÑ\80маÑ\82е
+ $this->assertStringContainsString('FW\-1', $message);
}
/**
$this->assertStringContainsString('<th>Интервал</th>', $html);
$this->assertStringContainsString('<th>Заказ</th>', $html);
$this->assertStringContainsString('<th>РМК</th>', $html);
- $this->assertStringContainsString('<th>МП / Причина</th>', $html);
+ $this->assertStringContainsString('<th>МП</th>', $html);
+ $this->assertStringContainsString('<th>Причина</th>', $html);
}
/**
$html = $this->service->formatEmailControlReport($result);
$this->assertStringContainsString('Успех без чека', $html);
- $this->assertStringContainsString('Нет seller_id', $html);
+ $this->assertStringContainsString('Не взят в работу', $html);
}
/**
{
$service = new OrderControlReportService();
- $this->assertFalse($service->isAsyncMode());
-
- $service->setAsyncMode(true);
$this->assertTrue($service->isAsyncMode());
$service->setAsyncMode(false);
$this->assertFalse($service->isAsyncMode());
+
+ $service->setAsyncMode(true);
+ $this->assertTrue($service->isAsyncMode());
}
}