Fix customer data query - remove invalid t.UserID join
Tasks table doesn't have UserID column. Customer data comes from Order.UserID only. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b1a263bb36
commit
d8565deda1
1 changed files with 5 additions and 6 deletions
|
|
@ -58,18 +58,17 @@
|
|||
COALESCE(sp.Name, tsp.Name) AS ServicePointName,
|
||||
COALESCE(sp.TypeID, tsp.TypeID) AS ServicePointTypeID,
|
||||
COALESCE(sp.ID, tsp.ID) AS ServicePointID,
|
||||
COALESCE(u.ID, tu.ID) AS CustomerUserID,
|
||||
COALESCE(u.FirstName, tu.FirstName) AS FirstName,
|
||||
COALESCE(u.LastName, tu.LastName) AS LastName,
|
||||
COALESCE(u.ContactNumber, tu.ContactNumber) AS ContactNumber,
|
||||
COALESCE(u.ImageExtension, tu.ImageExtension) AS CustomerImageExtension
|
||||
u.ID AS CustomerUserID,
|
||||
u.FirstName,
|
||||
u.LastName,
|
||||
u.ContactNumber,
|
||||
u.ImageExtension AS CustomerImageExtension
|
||||
FROM Tasks t
|
||||
LEFT JOIN TaskCategories tc ON tc.ID = t.CategoryID
|
||||
LEFT JOIN Orders o ON o.ID = t.OrderID
|
||||
LEFT JOIN ServicePoints sp ON sp.ID = o.ServicePointID
|
||||
LEFT JOIN ServicePoints tsp ON tsp.ID = t.ServicePointID
|
||||
LEFT JOIN Users u ON u.ID = o.UserID
|
||||
LEFT JOIN Users tu ON tu.ID = t.UserID
|
||||
WHERE t.ID = ?
|
||||
", [ { value = TaskID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||
|
||||
|
|
|
|||
Reference in a new issue