fix some tests
fix merge issues
This commit is contained in:
@ -50,8 +50,8 @@ class Actor extends RequestBase {
|
||||
// query the actors corresponding to video
|
||||
$video_id = $_POST["videoid"];
|
||||
|
||||
$query = "SELECT actor_id, name, thumbnail FROM actors_videos
|
||||
JOIN actors a on actors_videos.actor_id = a.id
|
||||
$query = "SELECT a.actor_id, name, thumbnail FROM actors_videos
|
||||
JOIN actors a on actors_videos.actor_id = a.actor_id
|
||||
WHERE actors_videos.video_id=$video_id";
|
||||
$result = $this->conn->query($query);
|
||||
$this->commitMessage(json_encode(mysqli_fetch_all($result, MYSQLI_ASSOC)));
|
||||
@ -65,7 +65,9 @@ class Actor extends RequestBase {
|
||||
WHERE actors_videos.actor_id=$actorid";
|
||||
$result = $this->conn->query($query);
|
||||
|
||||
$reply = array("videos" => mysqli_fetch_all($result, MYSQLI_ASSOC));
|
||||
$actorinfo = $this->conn->query("SELECT name, thumbnail, actor_id FROM actors WHERE actor_id=$actorid");
|
||||
|
||||
$reply = array("videos" => mysqli_fetch_all($result, MYSQLI_ASSOC), "info" => mysqli_fetch_assoc($actorinfo));
|
||||
|
||||
$this->commitMessage(json_encode($reply));
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ class Video extends RequestBase {
|
||||
$query = "SELECT movie_id,movie_name FROM videos
|
||||
INNER JOIN video_tags vt on videos.movie_id = vt.video_id
|
||||
INNER JOIN tags t on vt.tag_id = t.tag_id
|
||||
WHERE t.tag_name = '$tag'
|
||||
WHERE t.tag_id = '$tag'
|
||||
ORDER BY likes DESC, create_date, movie_name";
|
||||
}
|
||||
}
|
||||
@ -63,13 +63,13 @@ class Video extends RequestBase {
|
||||
$idstring = implode(" OR ", $ids);
|
||||
|
||||
$return->tags = array();
|
||||
$query = "SELECT t.tag_name FROM video_tags
|
||||
$query = "SELECT t.tag_name,t.tag_id FROM video_tags
|
||||
INNER JOIN tags t on video_tags.tag_id = t.tag_id
|
||||
WHERE $idstring
|
||||
GROUP BY t.tag_name";
|
||||
GROUP BY t.tag_id";
|
||||
$result = $this->conn->query($query);
|
||||
while ($r = mysqli_fetch_assoc($result)) {
|
||||
array_push($return->tags, $r);
|
||||
array_push($return->tags, array('tag_name' => $r['tag_name'], 'tag_id' => $r['tag_id']));
|
||||
}
|
||||
|
||||
$this->commitMessage(json_encode($return));
|
||||
@ -123,10 +123,10 @@ class Video extends RequestBase {
|
||||
|
||||
// load tags of this video
|
||||
$arr['tags'] = array();
|
||||
$query = "SELECT t.tag_name FROM video_tags
|
||||
$query = "SELECT t.tag_name, t.tag_id FROM video_tags
|
||||
INNER JOIN tags t on video_tags.tag_id = t.tag_id
|
||||
WHERE video_tags.video_id=$video_id
|
||||
GROUP BY t.tag_name";
|
||||
GROUP BY t.tag_id";
|
||||
$result = $this->conn->query($query);
|
||||
while ($r = mysqli_fetch_assoc($result)) {
|
||||
array_push($arr['tags'], $r);
|
||||
@ -147,8 +147,8 @@ class Video extends RequestBase {
|
||||
}
|
||||
|
||||
// query the actors corresponding to video
|
||||
$query = "SELECT actor_id, name, thumbnail FROM actors_videos
|
||||
JOIN actors a on actors_videos.actor_id = a.id
|
||||
$query = "SELECT a.actor_id, name, thumbnail FROM actors_videos
|
||||
JOIN actors a on actors_videos.actor_id = a.actor_id
|
||||
WHERE actors_videos.video_id=$video_id";
|
||||
$result = $this->conn->query($query);
|
||||
$arr['actors'] = mysqli_fetch_all($result, MYSQLI_ASSOC);
|
||||
|
Reference in New Issue
Block a user