mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 17:33:09 +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:
@@ -1035,8 +1035,8 @@ def employee_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
{emp_cond}
|
||||
{fcond} {mcond}
|
||||
order by
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
if(locate(%(_txt)s, employee_name), locate(%(_txt)s, employee_name), 99999),
|
||||
(case when locate(%(_txt)s, name) > 0 then locate(%(_txt)s, name) else 99999 end),
|
||||
(case when locate(%(_txt)s, employee_name) > 0 then locate(%(_txt)s, employee_name) else 99999 end),
|
||||
idx desc,
|
||||
name, employee_name
|
||||
limit %(page_len)s offset %(start)s""".format(
|
||||
|
||||
Reference in New Issue
Block a user