Fix count when using joins.

This commit is contained in:
kj 2022-08-12 05:46:24 -04:00
parent 2411704662
commit 38d2a90318
1 changed files with 1 additions and 1 deletions

View File

@ -682,7 +682,7 @@ class Model {
$queryResult = static::query($sql, $resetQuery);
$result = $queryResult[0]['quantity'];
} else {
static::$querySelect['select'] = ["COUNT(".static::$primaryKey.") as quantity"];
static::$querySelect['select'] = ["COUNT(".static::table().".".static::$primaryKey.") as quantity"];
static::$querySelect['limit'] = '1';
static::$querySelect['orderBy'] = '';