1
0
Fork 0
mirror of synced 2025-04-02 21:36:14 +03:00

codestyle

This commit is contained in:
ellynoize 2024-12-25 12:43:17 +03:00
parent c9a4eeecf5
commit 14d350c695
2 changed files with 8 additions and 3 deletions

View file

@ -31,9 +31,12 @@
```
<?php
require_once __DIR__ . '/wp-load.php';
$options = getopt('',['entity::','page::']);
do_action("wp_console_upload", $options['entity'] ?? '', (int)$options['page'] ?? 0);
do_action('wp_console_upload', $options['entity'] ?? '', (int) $options['page'] ?? 0);
```
2. После чего в командной строке ввести команду для запуска скрипта: <br>

View file

@ -239,8 +239,8 @@ if (class_exists('WC_Retailcrm_Uploader') === false) {
public function uploadConsole($entity, $page = 0)
{
$ordersPages = ceil($this->getCountOrders() / 50);
$customerPages = ceil($this->getCountUsers() / 50);
$ordersPages = (int) ceil($this->getCountOrders() / 50);
$customerPages = (int) ceil($this->getCountUsers() / 50);
try {
switch ($entity) {
@ -264,6 +264,8 @@ if (class_exists('WC_Retailcrm_Uploader') === false) {
public function archiveUpload($entity, $page, $totalPages)
{
echo $entity . ' uploading started' . PHP_EOL;
do {
if ($entity === 'orders') {
$this->uploadArchiveOrders($page);