Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 00cdc758a14984c6c372506d04807209bd5fae8f 2 parents 32f6dec + 20b0693
Lorna Jane Mitchell authored
6  src/system/application/models/talks_model.php
@@ -249,7 +249,6 @@ public function getPopularTalks($len=7) {
249 249
                 t.talk_title,
250 250
                 t.ID,
251 251
                 count(tc.ID) as ccount,
252  
-                get_talk_rating(t.ID) as tavg,
253 252
                 e.ID eid,
254 253
                 e.event_name
255 254
             from
@@ -273,6 +272,11 @@ public function getPopularTalks($len=7) {
273 272
         $CI=&get_instance();
274 273
         $CI->load->model('talk_speaker_model','tsm');
275 274
         foreach ($talks as $k=>$talk) {
  275
+            $sql = "select get_talk_rating(" . $talk->ID . ") as tavg";
  276
+            $rating_result = $this->db->query($sql)->result();
  277
+            $rating = $rating_result[0];
  278
+            $talks[$k]->tavg = $rating->tavg;
  279
+
276 280
             $talks[$k]->speaker=$CI->tsm->getTalkSpeakers($talk->ID);
277 281
         }
278 282
         return $talks;

0 notes on commit 00cdc75

Please sign in to comment.
Something went wrong with that request. Please try again.