Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vmusicchart-cms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
vmusicchart-cms
Commits
cf372699
Commit
cf372699
authored
Apr 05, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chuyển BXH tuần sang data mới
parent
1e6af4e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
Report_views_monthly_model.php
application/models/Report_views_monthly_model.php
+2
-1
Report_views_weekly_model.php
application/models/Report_views_weekly_model.php
+13
-12
No files found.
application/models/Report_views_monthly_model.php
View file @
cf372699
...
...
@@ -2,7 +2,8 @@
class
Report_views_monthly_model
extends
CI_Model
{
protected
$_table
=
'reports_views_monthly'
;
protected
$_table
=
'reports_views_monthly'
;
protected
$_table_new
=
'report_views_monthly_new'
;
public
function
__construct
(){
parent
::
__construct
();
...
...
application/models/Report_views_weekly_model.php
View file @
cf372699
...
...
@@ -2,23 +2,22 @@
class
Report_views_weekly_model
extends
CI_Model
{
protected
$_table
=
'report_views_weekly'
;
protected
$_table
=
'report_views_weekly'
;
protected
$_table_new
=
'report_views_weekly_new'
;
public
function
__construct
(){
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Ho_Chi_Minh"
);
if
(
date
(
'W'
)
>
13
)
{
$this
->
_table
=
$this
->
_table_new
;
}
}
public
function
cmsCountAll
(
$name
=
null
)
{
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
// if ($name != null) {
// $this->db->like('title', $name, 'both');
// $this->db->or_like('description', $name, 'both');
// $this->db->or_like('slug', $name, 'both');
// $this->db->or_like('tag', $name, 'both');
// }
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
if
(
$result
)
{
...
...
@@ -33,28 +32,30 @@ class Report_views_weekly_model extends CI_Model
$this
->
db
->
select
(
$this
->
_table
.
'.*, u1.full_name AS singer_name, track_user.name AS singer_name2,
tracks.title AS name_song, GROUP_CONCAT(track_user.`name` SEPARATOR ",") AS all_name, tracks.art AS art'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
join
(
'track_user'
,
'track_user.track_id =
report_views_weekly
.track_id'
,
'left'
);
$this
->
db
->
join
(
'tracks'
,
'tracks.id =
report_views_weekly
.track_id'
,
'left'
);
$this
->
db
->
join
(
'track_user'
,
'track_user.track_id =
'
.
$this
->
_table
.
'
.track_id'
,
'left'
);
$this
->
db
->
join
(
'tracks'
,
'tracks.id =
'
.
$this
->
_table
.
'
.track_id'
,
'left'
);
$this
->
db
->
join
(
'users u1'
,
'u1.id = track_user.user_id'
,
'left'
);
if
(
$name
!=
null
)
{
$data
=
explode
(
'-'
,
$name
);
$this
->
db
->
where
(
'week'
,
$data
[
0
]);
$this
->
db
->
where
(
'year'
,
$data
[
1
]);
}
$this
->
db
->
group_by
(
'report_views_weekly
.id'
);
$this
->
db
->
group_by
(
$this
->
_table
.
'
.id'
);
$this
->
db
->
order_by
(
$this
->
_table
.
'.total_point'
,
'desc'
);
$this
->
db
->
limit
(
$record
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
selectSearch
()
{
public
function
selectSearch
()
{
$this
->
db
->
select
(
'week, year'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
distinct
(
$this
->
_table
.
'.week'
);
$this
->
db
->
order_by
(
$this
->
_table
.
'.year desc'
);
$this
->
db
->
order_by
(
$this
->
_table
.
'.week desc'
);
$this
->
db
->
limit
(
15
);
$this
->
db
->
limit
(
60
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment