'user', 'on' => 'contents_comment.con_user_id = user.user_id', 'type' => 'inner'); $join[] = array('table' => 'contents', 'on' => 'contents_comment.con_id = contents.con_id', 'type' => 'inner'); $result = $this->_get_list_common($select, $join, $limit, $offset, $where, $like, $findex, $forder, $sfield, $skeyword, $sop); return $result; } public function get_api_list($app_id= '', $con_id = '') { $select = 'contents_comment.com_id, contents_comment.con_id, com_content, contents_comment.user_id, com_created_at, com_updated_at, user.user_username, user.user_photo'; $this->db->select($select); $this->db->join('user', 'contents_comment.user_id = user.user_id', 'left'); $this->db->where('contents_comment.con_id', $con_id); $this->db->where('contents_comment.app_id', $app_id); $this->db->order_by('com_num', 'asc'); $this->db->order_by('com_reply', 'asc'); $qry = $this->db->get($this->_table); $result = $qry->result_array(); return $result; } public function get_count($con_id) { $this->db->where(array('con_id' => $con_id)); $this->db->join('user', 'contents_comment.user_id = user.user_id', 'inner'); $result = $this->db->count_all_results($this->_table); return $result; } public function next_comment_num() { $this->db->select_min('com_num'); $result = $this->db->get($this->_table); $row = $result->row_array(); $row['com_num'] = (isset($row['com_num']) && is_numeric($row['com_num'])) ? $row['com_num'] : 0; $com_num = $row['com_num'] - 1; return $com_num; } }