Fix count when using joins.
This commit is contained in:
parent
2411704662
commit
38d2a90318
@ -682,7 +682,7 @@ class Model {
|
|||||||
$queryResult = static::query($sql, $resetQuery);
|
$queryResult = static::query($sql, $resetQuery);
|
||||||
$result = $queryResult[0]['quantity'];
|
$result = $queryResult[0]['quantity'];
|
||||||
} else {
|
} 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['limit'] = '1';
|
||||||
static::$querySelect['orderBy'] = '';
|
static::$querySelect['orderBy'] = '';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user