Преглед изворни кода

Add where clause only if conditions exists (#3853)

version-14
Nabin Hait пре 8 година
committed by Rushabh Mehta
родитељ
комит
b524d892f7
1 измењених фајлова са 3 додато и 2 уклоњено
  1. +3
    -2
      frappe/database.py

+ 3
- 2
frappe/database.py Прегледај датотеку

@@ -600,8 +600,9 @@ class Database:

order_by = ("order by " + order_by) if order_by else ""

r = self.sql("select {0} from `tab{1}` where {2} {3}".format(fl, doctype,
conditions, order_by), values, as_dict=as_dict, debug=debug, update=update)
r = self.sql("select {0} from `tab{1}` {2} {3} {4}"
.format(fl, doctype, "where" if conditions else "", conditions, order_by), values,
as_dict=as_dict, debug=debug, update=update)

return r



Loading…
Откажи
Сачувај