Fix. Replace a pair of id_user with user_id - refs #7272

1.9.x
Imanol Losada 10 years ago
parent 40ea9ccc8a
commit 7e0404a210
  1. 4
      plugin/buycourses/src/buy_course.lib.php

@ -330,7 +330,7 @@ function checkUserBuy($parameter, $user, $type = 'COURSE')
*/
function checkUserBuyTransfer($parameter, $user, $type = 'COURSE')
{
$sql = "SELECT 1 FROM %s WHERE %s ='" . Database::escape_string($parameter) . "' AND id_user='" . intval($user) . "';";
$sql = "SELECT 1 FROM %s WHERE %s ='" . Database::escape_string($parameter) . "' AND user_id='" . intval($user) . "';";
$sql = $type === 'SESSION' ?
sprintf($sql, Database::get_main_table(TABLE_BUY_SESSION_TEMPORARY), 'session_id') :
sprintf($sql, Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL), 'course_code');
@ -521,7 +521,7 @@ function sessionInfo($code)
//check if the user is enrolled in the current session
if ($currentUserId > 0) {
$sql = "SELECT 1 FROM $tableSessionRelUser
WHERE user_id='".$currentUserId."';";
WHERE id_user='".$currentUserId."';";
Database::query($sql);
if (Database::affected_rows() > 0) {
$rowSession['enrolled'] = "YES";

Loading…
Cancel
Save