mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-01 12:38:27 +00:00
refactor: if() to CASE WHEN (#31360)
* refactor: if() to CASE WHEN * fix: remove duplicate order by * fix: remove extraneous table * style: reformat to black spec Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -387,8 +387,8 @@ def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
|
||||
or full_name like %(txt)s)
|
||||
{fcond} {mcond}
|
||||
order by
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
if(locate(%(_txt)s, full_name), locate(%(_txt)s, full_name), 99999),
|
||||
(case when locate(%(_txt)s, name) > 0 then locate(%(_txt)s, name) else 99999 end),
|
||||
(case when locate(%(_txt)s, full_name) > 0 then locate(%(_txt)s, full_name) else 99999 end)
|
||||
idx desc,
|
||||
name, full_name
|
||||
limit %(page_len)s offset %(start)s""".format(
|
||||
|
||||
Reference in New Issue
Block a user