Compare commits

..

No commits in common. "document_to_site" and "1.3.0" have entirely different histories.

2 changed files with 4 additions and 9 deletions

View File

@ -1,7 +1,5 @@
# Google Sheets parser
Synchronizes Google Sheets with ArangoDB for [mirzaev/ebala](https://git.mirzaev.sexy/mirzaev/ebala)</br>
Synchronizes Google Sheets with ArangoDB
</br>
~~😼 Developed in 1 day for 100000 rubles ($1200)~~ shit happens</br>
**DEVELOPMENT COMPLETED. PROJECT CLOSED.**
~~😼 Developed in 1 day for 100000 rubles ($1200)~~ shit happens

View File

@ -84,11 +84,8 @@ function sync(Row &$row): void
// Инициализация ФИО
$name = explode(' ', $_row['name']);
// Инициализация идентификатора
if (empty($id = preg_replace('/([^^\d]?)(\d+).*/u', 'K$2', $_row['id']))) return;
if (collection::init($arangodb->session, 'market'))
if ($market = collection::search($arangodb->session, sprintf("FOR d IN market FILTER d.id == '%s' RETURN d", $id))) {
if (!empty($_row['id']) && $market = collection::search($arangodb->session, sprintf("FOR d IN market FILTER d.id == '%s' RETURN d", $_row['id']))) {
// Найдена запись магазина (строки) в базе данных и включен режим перезаписи (приоритет - google sheets)
if (false && $market->transfer_to_sheets) {
@ -130,7 +127,7 @@ function sync(Row &$row): void
sprintf(
"FOR d IN market FILTER d._id == '%s' RETURN d",
document::write($arangodb->session, 'market', [
'id' => $id,
'id' => $_row['id'] ?? '',
'type' => $_row['type'] ?? '',
'name' => [
'first' => $name[1] ?? $_row['name'] ?? '',