application/models/mobile_api/Common_model.php
/* Get the comment count of all room types*/
Get the comment count of all room types
Get the comment count of all room types
public function total_comment_count($post_data){
        $searchId = $post_data['searchId'];
        $shortlistedId = $post_data['shortlistedId'];
        $loginUserId = $post_data['loginUserId'];
        $roomType = $post_data['roomType'];
        $roomType = "'".$roomType."'";
        $sql = "SELECT 
                (SELECT COUNT(*) FROM comments c1 where c1.shortlistedId = c.shortlistedId AND c1.searchId = c.searchId AND c1.deleteFlag !=1) as total_comment_count
                FROM comments c WHERE c.shortlistedId = $shortlistedId AND c.searchId =$searchId GROUP BY c.shortlistedId";
        $record = $this->db->query($sql);        
            return $record->row('total_comment_count');
    }
public function total_comment_count ( $ post_data ) { $ searchId = $ post_data [ 'searchId' ] ; $ shortlistedId = $ post_data [ 'shortlistedId' ] ; $ loginUserId = $ post_data [ 'loginUserId' ] ; $ roomType = $ post_data [ 'roomType' ] ; $ roomType = " ' " . $ roomType . " ' " ; $ sql = " SELECT 
                (SELECT COUNT(*) FROM comments c1 where c1.shortlistedId = c.shortlistedId AND c1.searchId = c.searchId AND c1.deleteFlag !=1) as total_comment_count
                FROM comments c WHERE c.shortlistedId =  $ shortlistedId  AND c.searchId = $ searchId  GROUP BY c.shortlistedId " ; $ record = $ this -> db -> query ( $ sql ) ; return $ record -> row ( 'total_comment_count' ) ; }
Get the comment count of all room types
Get the comment count of all room types
// echo $sql;exit();