create wb-api parser
This commit is contained in:
commit
7a78dfc7aa
61 files changed
+11245
No files matched your search
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
FROM_START="${1:-2024-01-01}"
|
||||
TO_END="${2:-2026-06-30}"
|
||||
|
||||
for endpoint in sales orders incomes; do
|
||||
for m in $(seq 0 60); do
|
||||
from=$(date -d "$FROM_START +$m month" +%F)
|
||||
to=$(date -d "$from +1 month -1 day" +%F)
|
||||
|
||||
[[ "$from" > "$TO_END" ]] && break
|
||||
[[ "$to" > "$TO_END" ]] && to="$TO_END"
|
||||
|
||||
echo "=== $endpoint $from -> $to ==="
|
||||
php -d memory_limit=1024M artisan wb:sync --endpoint="$endpoint" --from="$from" --to="$to"
|
||||
done
|
||||
echo
|
||||
done
|
||||
|
||||
php -d memory_limit=1024M artisan wb:sync --endpoint=stocks --stocks-date="$FROM_START"
|
||||
Reference in new issue
Block a user