DB Error #1054

часто возникающие проблемы при установке
Ответить
obmen86
Сообщения: 1
Зарегистрирован: 30 июн 2019, 04:16

DB Error #1054

Сообщение obmen86 » 30 июн 2019, 04:18

Здравствуйте.
Подскажите в чем проблема.
Не могу найти ошибку из-за чего возникла...
Ошибки летят одна за другой, почту заспамило уже

Код: Выделить всё

[SELECT COUNT(DISTINCT CASE WHEN A2.`state` IN ('open', 'closed', 'archived', 'deleted') AND NOT A1.`topic_id` = 0 AND A8.`name` IS NOT NULL AND A7.`name` IS NOT NULL AND B0.`topic` IS NOT NULL AND A1.`number` IS NOT NULL AND A1.`ticket_id` = Z1.`ticket_id` THEN A1.`ticket_id` END) AS `q15`, COUNT(DISTINCT CASE WHEN A2.`state` = 'open' THEN A1.`ticket_id` END) AS `q1`, COUNT(DISTINCT CASE WHEN A2.`state` = 'open' AND A2.`state` = 'open' AND A1.`isanswered` = '0' THEN A1.`ticket_id` END) AS `q2`, COUNT(DISTINCT CASE WHEN A1.`staff_id` IN (1) AND A2.`state` = 'open' AND A1.`staff_id` IN (1) AND A2.`state` = 'open' AND A1.`staff_id` IN (1) THEN A1.`ticket_id` END) AS `q6`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2019-06-29 22:00:00' AND '2019-06-30 21:59:59' THEN A1.`ticket_id` END) AS `q9`, COUNT(DISTINCT CASE WHEN A2.`state` = 'open' AND A2.`state` = 'open' AND A1.`isanswered` = '1' THEN A1.`ticket_id` END) AS `q3`, COUNT(DISTINCT CASE WHEN A1.`staff_id` IN (1) AND A2.`state` = 'open' AND A1.`staff_id` IN (1) AND A2.`state` = 'open' AND NOT A1.`staff_id` IN (1) THEN A1.`ticket_id` END) AS `q7`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2019-06-28 22:00:00' AND '2019-06-29 21:59:59' THEN A1.`ticket_id` END) AS `q10`, COUNT(DISTINCT CASE WHEN A2.`state` = 'open' AND A2.`state` = 'open' AND A1.`isoverdue` = '1' THEN A1.`ticket_id` END) AS `q4`, COUNT(DISTINCT CASE WHEN A1.`staff_id` IN (1) AND A2.`state` = 'open' THEN A1.`ticket_id` END) AS `q5`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2019-06-23 22:00:00' AND '2019-06-30 21:59:59' THEN A1.`ticket_id` END) AS `q11`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' THEN A1.`ticket_id` END) AS `q8`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2019-05-31 22:00:00' AND '2019-06-30 21:59:59' THEN A1.`ticket_id` END) AS `q12`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2019-03-31 22:00:00' AND '2019-06-30 21:59:59' THEN A1.`ticket_id` END) AS `q13`, COUNT(DISTINCT CASE WHEN A2.`state` = 'closed' AND A2.`state` = 'closed' AND A1.`closed` BETWEEN '2018-12-31 22:00:00' AND '2019-12-31 21:59:59' THEN A1.`ticket_id` END) AS `q14` FROM `os_ticket` A1 JOIN `os_ticket_status` A2 ON (A1.`status_id` = A2.`id`) LEFT JOIN `os_thread` A3 ON (A3.`object_type` = 'T' AND A1.`ticket_id` = A3.`object_id`) LEFT JOIN `os_thread_referral` A4 ON (A3.`id` = A4.`thread_id`) LEFT JOIN `os_staff` A5 ON (A4.`object_type` = 'S' AND A4.`object_id` = A5.`staff_id`) LEFT JOIN `os_department` A6 ON (A4.`object_type` = 'D' AND A4.`object_id` = A6.`id`) JOIN `os_user` A7 ON (A1.`user_id` = A7.`id`) LEFT JOIN `os_organization` A8 ON (A7.`org_id` = A8.`id`) LEFT JOIN `os_help_topic` B0 ON (A1.`topic_id` = B0.`topic_id`) WHERE (A2.`state` = 'open' AND (A1.`staff_id` = 1 OR A5.`staff_id` = 1)) OR A1.`dept_id` IN (3, 4) OR A6.`id` IN (3, 4)]

Unknown column 'Z1.ticket_id' in 'field list'<br />
<br />
---- Трассировка ----<br />
#0 (корень)/include/mysqli.php(199): osTicket->logDBError('DB Error #1054', '[SELECT COUNT(D...')<br />
#1 (корень)/include/class.orm.php(3455): db_query('SELECT COUNT(DI...', true, true)<br />
#2 (корень)/include/class.orm.php(3502): MySqlExecutor->execute()<br />
#3 (корень)/include/class.orm.php(2085): MySqlExecutor->getArray()<br />
#4 (корень)/include/class.orm.php(2035): HashArrayIterator->{closure}()<br />
#5 (корень)/include/class.orm.php(2014): CallbackSimpleIterator->next()<br />
#6 (корень)/include/class.orm.php(2023): CallbackSimpleIterator->rewind()<br />
#7 (корень)/include/class.orm.php(1695): CallbackSimpleIterator->valid()<br />
#8 (корень)/include/class.orm.php(1705): CachedResultSet->fillTo(9223372036854775807)<br />
#9 (корень)/include/class.orm.php(1328): CachedResultSet->asArray()<br />
#10 (корень)/include/class.orm.php(1351): QuerySet->all()<br />
#11 (корень)/include/class.search.php(925): QuerySet->one()<br />
#12 (корень)/include/class.search.php(865): SavedQueue::counts(Object(StaffSession), true)<br />
#13 (корень)/include/staff/templates/queue-tickets.tmpl.php(96): SavedQueue->getCount(Object(StaffSession))<br />
#14 (корень)/scp/tickets.php(526): require_once('/home/vh6u11261...')<br />
#15 {main}

Ответить