Ec (2); & nbsp; + callback & nbsp; * @ parammixed $ where data & nbsp; & nbsp; * @ paramstring $ tab script ec (2); script
+ ----------------------------------------------------------
* @ Param mixed $ where data
* @ Param string $ tables data table name
* @ Param string $ fields field name
* @ Param string $ order sorting
* @ Param string $ limit
* @ Param string $ group
* @ Param string $ having
* @ Param boolean $ whether the cache is cached
* @ Param boolean $ lazy indicates whether to load the data asynchronously.
* @ Param boolean $ whether lock is locked
+ ----------------------------------------------------------
* @ Return ArrayObject
+ ----------------------------------------------------------
* @ Throws ThinkExecption
+ ----------------------------------------------------------
*/
Public function find ($ where, $ tables, $ fields = '*', $ order = null, $ limit = null, $ group = null, $ having = null, $ join = null, $ cache = false, $ lazy = false, $ lock = false)
{
If (in_array ($ this-> getDbType (), array ('mssql', 'ibase '), true )){
$ This-> queryStr = 'select'. $ this-> parseLimit ($ limit)
. $ This-> parseFields ($ fields)
. 'From'. $ tables
. $ This-> parseJoin ($ join)
. $ This-> parseWhere ($ where)
. $ This-> parseGroup ($ group)
. $ This-> parseHaving ($ having)
. $ This-> parseOrder ($ order );
} Else {
$ This-> queryStr = 'select'. $ this-> parseFields ($ fields)
. 'From'. $ tables
. $ This-> parseJoin ($ join)
. $ This-> parseWhere ($ where)
. $ This-> parseGroup ($ group)
. $ This-> parseHaving ($ having)
. $ This-> parseOrder ($ order );
If ("ORACLE" = $ this-> getDbType ())
If ($ limit [0] <= 0 ){
If ($ limit [1]> 0)
$ This-> queryStr = "SELECT * FROM (". $ this-> queryStr. ") where rownum <=". $ limit [1];
} Else {
$ WhereClause = "";
If ($ limit [1]> 0)
$ WhereClause = "where rownum <=". ($ limit [0] + $ limit [1]);
$ This-> queryStr = "SELECT * FROM (select row _. *, ROWNUM _ FROM ("
. $ This-> queryStr. ") ROW _"
. $ WhereClause
. ") Where rownum _>"
. $ Limit [0];
}
Else
$ This-> queryStr. = $ this-> parseLimit ($ limit );
}
Return $ this-> query ('', $ cache, $ lazy, $ lock );
}