diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index baed5293..a8301e89 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -1463,7 +1463,7 @@ class ServiceController extends Zend_Controller_Action echo 0; return; } - $sql = "select count(md.id) as total from mdref mr + $sql = "select count(distinct md.id) as total from mdref mr right join normalmetadata md on md.uuid=mr.uuid where mr.refid=$id"; $rs = $this->db->query($sql);