viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Speed up getGroupPageCount query

Chris Pollett [2020-06-23 21:Jun:rd]
Speed up getGroupPageCount query
Filename
src/models/GroupModel.php
diff --git a/src/models/GroupModel.php b/src/models/GroupModel.php
index 2dce760a4..6df564beb 100644
--- a/src/models/GroupModel.php
+++ b/src/models/GroupModel.php
@@ -3488,7 +3488,7 @@ EOD;
     public function getGroupPageCount($group_id)
     {
         $sql = "SELECT COUNT(*) AS TOTAL
-            FROM GROUP_PAGE WHERE GROUP_ID = ? AND LENGTH(PAGE) > 0";
+            FROM GROUP_PAGE WHERE GROUP_ID = ? AND PAGE) <> ''";
         $result = $this->db->execute($sql, [$group_id]);
         $row = $this->db->fetchArray($result);
         $total = ($row) ? $row["TOTAL"] : 0;
ViewGit