|
|
@@ -450,7 +450,12 @@ class ACL {
|
|
|
$refConf = ACL::getRefConfig($namespace, $childTypeName);
|
|
|
$refTable = $refConf->tableName; // ACL::getRefTable($namespace, $childTypeName);
|
|
|
if (V::get('total', false, $params)) {
|
|
|
- return DB::getPDO()->fetchValue(" select count(*) as cnt from `{$refTable}` where PRIMARY_KEY = :primary_key and A_STATUS not in ('DELETED') ", [ ':primary_key' => $primaryKey ]);
|
|
|
+ return (int)DB::getPDO()->fetchValue("
|
|
|
+ select count( DISTINCT REMOTE_PRIMARY_KEY ) as cnt
|
|
|
+ from `{$refTable}`
|
|
|
+ where PRIMARY_KEY = :primary_key
|
|
|
+ and A_STATUS not in ('DELETED')
|
|
|
+ ", [ ':primary_key' => $primaryKey ]);
|
|
|
}
|
|
|
|
|
|
return DB::getPDO()->fetchValuesList("
|