Skip to content
Permalink
Browse files

Learnpath: Optimizate query to get player - refs BT#15533

  • Loading branch information...
AngelFQC committed Apr 11, 2019
1 parent 901db97 commit 82697e63faec970e6b5d18ef0ed6c7fa80dfb5f7
Showing with 8 additions and 1 deletion.
  1. +8 −1 main/lp/learnpath.class.php
@@ -2298,11 +2298,16 @@ public function get_mediaplayer($lpItemId, $autostart = 'true')
$tbl_lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$lpItemId = (int) $lpItemId;
/** @var learnpathItem $item */
$item = $this->items[$lpItemId];
$itemViewId = (int) $item->db_item_view_id;
// Getting all the information about the item.
$sql = "SELECT * FROM $tbl_lp_item as lpi
$sql = "SELECT lpi.audio, lpi.item_type, lp_view.status FROM $tbl_lp_item as lpi
INNER JOIN $tbl_lp_item_view as lp_view
ON (lpi.iid = lp_view.lp_item_id)
WHERE
lp_view.iid = $itemViewId AND
lpi.iid = $lpItemId AND
lp_view.c_id = $course_id";
$result = Database::query($sql);
@@ -2336,6 +2341,8 @@ public function get_mediaplayer($lpItemId, $autostart = 'true')
$autostart_audio = 'true';
}
error_log($autostart_audio);

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Apr 11, 2019

Member

🥺🧐

This comment has been minimized.

Copy link
@AngelFQC

AngelFQC Apr 11, 2019

Author Member

😮

This comment has been minimized.

Copy link
@AngelFQC

AngelFQC Apr 11, 2019

Author Member

Borrado aquí 262fe93

$courseInfo = api_get_course_info();
$audio = $row['audio'];

0 comments on commit 82697e6

Please sign in to comment.
You can’t perform that action at this time.