Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add prefix to tables in raw select #107

Merged
merged 2 commits into from
Feb 26, 2021

Conversation

sjefmoling
Copy link

After installation of the sendportal-core into my project I ran into an Column not found Exception when accessing the dashboard. I propose fix that will prefix the tables in the raw-count-selects

 Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sendportal_messages.id' in 'field list' (SQL: select `aidbase_sendportal_campaigns`.`id` as `campaign_id`, count(sendportal_messages.id) as total, count(case when sendportal_messages.opened_at IS NOT NULL then 1 end) as opened, count(case when sendportal_messages.clicked_at IS NOT NULL then 1 end) as clicked, count(case when sendportal_messages.sent_at IS NOT NULL then 1 end) as sent, count(case when sendportal_messages.bounced_at IS NOT NULL then 1 end) as bounced, count(case when sendportal_messages.sent_at IS NULL then 1 end) as pending from `aidbase_sendportal_campaigns` left join `aidbase_sendportal_messages` on `aidbase_sendportal_messages`.`source_id` = `aidbase_sendportal_campaigns`.`id` and `aidbase_sendportal_messages`.`source_type` = Sendportal\Base\Models\Campaign and 0 = 1 and `aidbase_sendportal_messages`.`workspace_id` = 1 group by `aidbase_sendportal_campaigns`.`id` order by `aidbase_sendportal_campaigns`.`id` asc)

Copy link
Contributor

@JonoB JonoB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@JonoB JonoB merged commit 4d30043 into mettle:master Feb 26, 2021
@sjefmoling
Copy link
Author

Thanks for the PR!

happy to code along

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants