Ignore orderby on count.

This commit is contained in:
kj 2021-08-14 17:45:23 -04:00
parent e3b97601e2
commit 8069fb28a1
1 changed files with 3 additions and 2 deletions

View File

@ -631,9 +631,10 @@ class ModelMySQL {
* @return int
*/
public static function count($resetQuery = true) {
static::$querySelect['select'] = ['1'];
static::$querySelect['select'] = ['1'];
static::$querySelect['sql_calc_found_rows'] = true;
static::$querySelect['limit'] = '1';
static::$querySelect['limit'] = '1';
static::$querySelect['orderBy'] = '';
$sql = static::buildQuery($resetQuery);
$result = static::query($sql)->fetch_assoc();
return static::found_row();