Skip to content

Commit

Permalink
monthly reports:
Browse files Browse the repository at this point in the history
- video views per month - per channel.
- Comment thumbs up per month/per person.
- video thumbs up per month per channel
  • Loading branch information
daniel authored and daniel committed Mar 28, 2018
1 parent 457af3e commit c917f3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions objects/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static function getTotalCommentsThumbsUpFromUser($users_id, $startDate, $endDate

if ($res) {
while ($row = $res->fetch_assoc()) {
$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND like = 1 ";
$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND `like` = 1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}
Expand All @@ -236,9 +236,9 @@ static function getTotalCommentsThumbsUpFromUser($users_id, $startDate, $endDate
}
$res2 = $global['mysqli']->query($sql);

$r['thumbsUp']=$res2->num_rows;
$r['thumbsUp']+=$res2->num_rows;

$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND like = -1 ";
$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND `like` = -1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}
Expand All @@ -247,7 +247,7 @@ static function getTotalCommentsThumbsUpFromUser($users_id, $startDate, $endDate
$sql .= " AND `created` <= '{$endDate}' ";
}
$res2 = $global['mysqli']->query($sql);
$r['thumbsDown']=$res2->num_rows;
$r['thumbsDown']+=$res2->num_rows;
}
}

Expand Down
4 changes: 2 additions & 2 deletions objects/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ static function getTotalVideosThumbsUpFromUser($users_id, $startDate, $endDate)

if ($res) {
while ($row = $res->fetch_assoc()) {
$sql = "SELECT id from likes WHERE comments_id = {$row['id']} AND like = 1 ";
$sql = "SELECT id from likes WHERE comments_id = {$row['id']} AND `like` = 1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}
Expand All @@ -1428,7 +1428,7 @@ static function getTotalVideosThumbsUpFromUser($users_id, $startDate, $endDate)

$r['thumbsUp']=$res2->num_rows;

$sql = "SELECT id from likes WHERE comments_id = {$row['id']} AND like = -1 ";
$sql = "SELECT id from likes WHERE comments_id = {$row['id']} AND `like` = -1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}
Expand Down

0 comments on commit c917f3d

Please sign in to comment.