Permalink
Browse files

Merge remote-tracking branch 'lornajane/talk-ratings-query'

  • Loading branch information...
2 parents 32f6dec + 20b0693 commit 00cdc758a14984c6c372506d04807209bd5fae8f @lornajane committed Apr 29, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/system/application/models/talks_model.php
@@ -249,7 +249,6 @@ public function getPopularTalks($len=7) {
t.talk_title,
t.ID,
count(tc.ID) as ccount,
- get_talk_rating(t.ID) as tavg,
e.ID eid,
e.event_name
from
@@ -273,6 +272,11 @@ public function getPopularTalks($len=7) {
$CI=&get_instance();
$CI->load->model('talk_speaker_model','tsm');
foreach ($talks as $k=>$talk) {
+ $sql = "select get_talk_rating(" . $talk->ID . ") as tavg";
+ $rating_result = $this->db->query($sql)->result();
+ $rating = $rating_result[0];
+ $talks[$k]->tavg = $rating->tavg;
+
$talks[$k]->speaker=$CI->tsm->getTalkSpeakers($talk->ID);
}
return $talks;

0 comments on commit 00cdc75

Please sign in to comment.