Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Minor fix, fixes #959 #961

Merged
merged 4 commits into from
Apr 26, 2022
Merged

Minor fix, fixes #959 #961

merged 4 commits into from
Apr 26, 2022

Conversation

smoleniuch
Copy link
Contributor

It fixes sql queries for listing orders in admins panel.

This query was being made before fix:

select `ti_orders`.*,
 concat(first_name, ' ', last_name) as `full_name`,
 (select status_name from `ti_statuses` where `ti_orders`.`status_id` = `ti_statuses`.`status_id`) as `status_name`,
 (select name from `ti_payments` where `ti_orders`.`payment` = `ti_payments`.`code`) as `payment` from `ti_orders`
 order by `location_name` asc 

After fix

select `ti_orders`.*,
 (select location_name from `ti_locations` where `ti_orders`.`location_id` = `ti_locations`.`location_id`) as `location_name`,
 concat(first_name, ' ', last_name) as `full_name`,
 (select status_name from `ti_statuses` where `ti_orders`.`status_id` = `ti_statuses`.`status_id`) as `status_name`,
 (select name from `ti_payments` where `ti_orders`.`payment` = `ti_payments`.`code`) as `payment`
 from `ti_orders` order by `location_name` asc

Based on my poor MySQL knowledge, location_name column does not exists in orders table.
It should be parsed through relation with locations table.

Query is generated somewhere here
But i cant figure it out where exactly.

web-smith and others added 2 commits April 23, 2022 22:24
Fixes generated sql queries for orders made by registered customers.
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
@sampoyigi sampoyigi closed this Apr 26, 2022
@sampoyigi sampoyigi reopened this Apr 26, 2022
@sampoyigi sampoyigi merged commit 03126c9 into tastyigniter:3.x Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants