Created
December 4, 2012 20:24
-
-
Save objectivehtml/4208306 to your computer and use it in GitHub Desktop.
Joining another table to an channel entries using Channel Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Showtimes_model extends CI_Model { | |
| public function get_showtimes($params = array()) | |
| { | |
| $default_params = array( | |
| 'select' => array( | |
| 'count(exp_showtimes.id) as \'total_showtimes\'', | |
| 'showtimes.*' | |
| ), | |
| 'join' => array( | |
| 'showtimes' => 'channel_data.entry_id = showtimes.entry_id' | |
| ), | |
| 'group_by' => 'showtimes.entry_id' | |
| ); | |
| $params = array_merge($default_params, $params); | |
| return $this->channel_data->get_entries($params); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment