SS ошибка в запросе фильтра покупателей Исправлено

1

2019-01-03 01:06:03 31.129.195.189
Query Error 1052: Column 'value' in on clause is ambiguous
Query: SELECT c.id,c.name,c.firstname,c.middlename,c.lastname,c.title,c.company,c.jobtitle,c.company_contact_id,c.is_company,c.is_user,c.login,c.last_datetime,c.sex,c.birth_day,c.birth_month,c.birth_year,c.about,c.photo,c.create_datetime,c.create_app_id,c.create_method,c.create_contact_id,c.locale,c.timezone,so1.create_datetime AS last_order_datetime,sc1.contact_id,sc1.total_spent,sc1.affiliate_bonus,sc1.number_of_orders,sc1.last_order_id,sc1.source,so1.create_datetime AS last_order_datetime
FROM wa_contact c  JOIN shop_customer sc1 ON c.id = sc1.contact_id LEFT JOIN shop_order so1 ON sc1.last_order_id = so1.id  JOIN shop_order_params sop1 ON sop1.order_id = so1.id AND sop1.name = 'referer_host'  JOIN shop_order_params sop2 ON sop2.order_id = so1.id AND sop2.name = 'utm_campaign' AND value = 'switips_cashbacks'
WHERE sc1.number_of_orders >= '1' AND sop1.value = 'switips.com'
 GROUP BY c.id

 ORDER BY last_order_id DESC
LIMIT 30
## wa-system/database/waModel.class.php(257)
#0 wa-system/database/waModel.class.php(357): waModel->run('SELECT c.id,c.n...')
#1 wa-system/contact/waContactsCollection.class.php(231): waModel->query('SELECT c.id,c.n...')
#2 wa-apps/shop/lib/classes/shopCustomersCollection.class.php(23): waContactsCollection->getContacts('*,order.create_...', 0, 30)
#3 wa-apps/shop/lib/actions/customers/shopCustomersList.action.php(24): shopCustomersCollection->getCustomers('*,order.create_...', 0, 30)
#4 wa-system/controller/waViewAction.class.php(160): shopCustomersListAction->execute()
#5 wa-system/controller/waViewController.class.php(86): waViewAction->display()
#6 wa-system/controller/waDefaultViewController.class.php(48): waViewController->executeAction(Object(shopCustomersListAction))
#7 wa-system/controller/waController.class.php(21): waDefaultViewController->execute()
#8 wa-system/controller/waViewController.class.php(46): waController->run(NULL)
#9 wa-system/controller/waFrontController.class.php(254): waViewController->run(NULL)
#10 wa-system/controller/waFrontController.class.php(189): waFrontController->runController(Object(waDefaultViewController), NULL)
#11 wa-system/controller/waFrontController.class.php(83): waFrontController->execute(NULL, 'customers', 'list')
#12 wa-system/waSystem.class.php(615): waFrontController->dispatch()
#13 wa-system/waSystem.class.php(538): waSystem->dispatchBackend('webasyst/shop/')
#14 index.php(7): waSystem->dispatch()
#15 {main}

Пропущен алиас таблицы

sop2.name = 'utm_campaign' AND value = 'switips_cashbacks'


Фильтр сформирован через админку и выглядит так 'app.number_of_orders>=1&app.referer=switips.com&app.utm_campaign=switips_cashbacks', причем если вручную заменить его на 'app.number_of_orders>=1&app.utm_campaign=switips_cashbacks&app.referer=switips.com', то вроде бы все ок.

0 комментариев

    Добавить комментарий

    Чтобы добавить комментарий, зарегистрируйтесь или войдите