application/models/mobile_api/Common_model.php
/* Get count of my invitation list */
Get count of my invitation list
Get count of my invitation list
public function count_MyInvitationList($post_data){
        $userId = $post_data['userId'];
        $keyword = $post_data['keyword'];
        if(!empty($keyword)){
            $keyword = "AND (s.searchName LIKE '%$keyword%' OR u.firstName LIKE '%$keyword%' OR s.searchId LIKE '%$keyword%' OR u.userId LIKE '%$keyword%' OR t.inviteEmail LIKE '%$keyword%' OR u.email LIKE '%$keyword%')";
        }
        $sql = "SELECT t.*,u.userId,u.firstName,u.email,s.searchName FROM tribe t
                LEFT JOIN users u ON t.fromuserId = u.userId AND u.deleteFlag !=1
                LEFT JOIN searchcriteria s on t.searchId = s.searchId 
                WHERE  t.touserId = $userId $keyword AND t.deleteFlag !=1 AND (t.status = '' OR t.status IS NULL) AND  s.deleteFlag !=1 ORDER BY t.createdAt DESC";
        $record = $this->db->query($sql);
        if($record->num_rows()>0){
            return $record->num_rows();
        }else{
            return false;
        }
    }
public function count_MyInvitationList ( $ post_data ) { $ userId = $ post_data [ 'userId' ] ; $ keyword = $ post_data [ 'keyword' ] ; if ( ! empty ( $ keyword ) ) { $ keyword = " AND (s.searchName LIKE '% $ keyword %' OR u.firstName LIKE '% $ keyword %' OR s.searchId LIKE '% $ keyword %' OR u.userId LIKE '% $ keyword %' OR t.inviteEmail LIKE '% $ keyword %' OR u.email LIKE '% $ keyword %') " ; } $ sql = " SELECT t.*,u.userId,u.firstName,u.email,s.searchName FROM tribe t
                LEFT JOIN users u ON t.fromuserId = u.userId AND u.deleteFlag !=1
                LEFT JOIN searchcriteria s on t.searchId = s.searchId 
                WHERE  t.touserId =  $ userId $ keyword  AND t.deleteFlag !=1 AND (t.status = '' OR t.status IS NULL) AND  s.deleteFlag !=1 ORDER BY t.createdAt DESC " ; $ record = $ this -> db -> query ( $ sql ) ; if ( $ record -> num_rows ( ) > 0 ) { return $ record -> num_rows ( ) ; } else { return false ; } }
Get count of my invitation list
Get count of my invitation list