added contact edit button
This commit is contained in:
@@ -152,21 +152,16 @@ class ConstructionConsentProject extends mfBaseModel {
|
||||
|
||||
public static function count($filter) {
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT COUNT(*) as cnt FROM ConstructionConsentProject
|
||||
LEFT JOIN ConstructionConsentNetwork ON (ConstructionConsentNetwork.constructionconsentproject_id = ConstructionConsentNetwork.id)
|
||||
WHERE $where
|
||||
GROUP BY ConstructionConsentProject.id
|
||||
";
|
||||
$sql = "SELECT COUNT(*) AS cnt FROM ConstructionConsentProject WHERE $where";
|
||||
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
$result = $db->query($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
return $data->cnt;
|
||||
if ($result && $db->num_rows($result) > 0) {
|
||||
$data = $db->fetch_object($result);
|
||||
return (int)$data->cnt;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -217,6 +212,22 @@ class ConstructionConsentProject extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("id", $filter)) {
|
||||
if(is_numeric($filter["id"])) {
|
||||
$where .= " AND ConstructionConsentProject.id = ".$filter["id"];
|
||||
} elseif(is_array($filter["id"])) {
|
||||
$ids = [];
|
||||
foreach($filter["id"] as $id) {
|
||||
if(is_numeric($id)) {
|
||||
$ids[] = $id;
|
||||
}
|
||||
}
|
||||
if(count($ids)) {
|
||||
$where .= " AND ConstructionConsentProject.id IN (".implode(",", $ids).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(array_key_exists("add-where", $filter)) {
|
||||
|
||||
Reference in New Issue
Block a user