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
3f52cb10
Commit
3f52cb10
authored
Jul 01, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cập nhật lọc theo những ài đã chặn lấy lượt nghe
parent
c59c76ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
33 deletions
+25
-33
CmsTrack.php
application/controllers/backend/CmsTrack.php
+3
-2
Track_model.php
application/models/Track_model.php
+9
-28
list_track_view.php
application/views/backend/cms_track/list_track_view.php
+13
-3
No files found.
application/controllers/backend/CmsTrack.php
View file @
3f52cb10
...
...
@@ -42,6 +42,7 @@ class CmsTrack extends CI_Controller
$fBySource
=
$this
->
input
->
post
(
'fBySource'
);
$fBySinger
=
$this
->
input
->
post
(
'fBySinger'
);
$fByComposer
=
$this
->
input
->
post
(
'fByComposer'
);
$fByBlacklist
=
$this
->
input
->
post
(
'fByBlacklist'
);
$pageId
=
$this
->
input
->
post
(
'pageId'
);
//
$pageId
=
(
$pageId
==
0
)
?
1
:
$pageId
;
...
...
@@ -49,9 +50,9 @@ class CmsTrack extends CI_Controller
$limit
=
100
;
$offset
=
(
$pageId
-
1
)
*
$limit
;
$data
[
'offset'
]
=
(
$pageId
-
1
)
*
$limit
;
$totalRecord
=
$this
->
track_model
->
cmsCountAll
(
$fByName
,
$fBySinger
,
$fByComposer
,
$fBySource
);
$totalRecord
=
$this
->
track_model
->
cmsCountAll
(
$fByName
,
$fBySinger
,
$fByComposer
,
$fBySource
,
$fByBlacklist
);
$data
[
'pagination'
]
=
MyHelper
::
genPaginationLink
(
$totalRecord
,
$limit
,
$pageId
);
$data
[
'listData'
]
=
$this
->
track_model
->
cmsGetPagination
(
$limit
,
$offset
,
$fByName
,
$fBySinger
,
$fByComposer
,
$fBySource
);
$data
[
'listData'
]
=
$this
->
track_model
->
cmsGetPagination
(
$limit
,
$offset
,
$fByName
,
$fBySinger
,
$fByComposer
,
$fBySource
,
$fByBlacklist
);
//
$this
->
load
->
view
(
'backend/ajax/cms_track/list_track_view'
,
$data
);
}
...
...
application/models/Track_model.php
View file @
3f52cb10
...
...
@@ -227,7 +227,7 @@ class Track_model extends CI_Model
return
$query
->
result_array
();
}
public
function
cmsCountAll
(
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
,
$fBySource
=
null
)
public
function
cmsCountAll
(
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
,
$fBySource
=
null
,
$fByBlacklist
=
null
)
{
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
...
...
@@ -265,6 +265,9 @@ class Track_model extends CI_Model
}
else
if
(
$fByComposer
==
2
)
{
$this
->
db
->
where
(
'composer_list'
,
null
);
}
if
(
$fByBlacklist
==
1
)
{
$this
->
db
->
where
(
'blacklist_listen is NOT NULL'
,
null
,
false
);
}
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
if
(
$result
)
{
...
...
@@ -274,32 +277,7 @@ class Track_model extends CI_Model
}
}
public
function
cmsGetPaginationBk
(
$record
,
$start
,
$name
=
null
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*, u1.full_name AS singer_name, u2.full_name AS composer_name,
track_user.name AS singer_name2, track_user.id AS id_user,
track_artists.name AS composer_name2, track_artists.id AS id_artist'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
join
(
$this
->
_table_track_user
,
'track_user.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
_table_track_artists
,
'track_artists.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
'users u1'
,
'u1.id = track_user.user_id'
,
'left'
);
$this
->
db
->
join
(
'users u2'
,
'u2.id = track_artists.user_id'
,
'left'
);
if
(
$name
!=
null
)
{
$this
->
db
->
like
(
'tracks.title'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.description'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.slug'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.tag'
,
$name
,
'both'
);
}
// $where = 'track_user.user_id !=0 AND track_artists.user_id != 0';
// $this->db->where($where);
$this
->
db
->
order_by
(
$this
->
_table
.
'.title'
,
'asc'
);
$this
->
db
->
limit
(
$record
,
$start
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
,
$fBySource
=
null
)
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
,
$fBySource
=
null
,
$fByBlacklist
=
null
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
...
...
@@ -337,10 +315,13 @@ class Track_model extends CI_Model
}
else
if
(
$fByComposer
==
2
)
{
$this
->
db
->
where
(
'composer_list'
,
null
);
}
if
(
$fByBlacklist
==
1
)
{
$this
->
db
->
where
(
'blacklist_listen is NOT NULL'
,
null
,
false
);
}
$this
->
db
->
order_by
(
$this
->
_table
.
'.id'
,
'desc'
);
$this
->
db
->
limit
(
$record
,
$start
);
$query
=
$this
->
db
->
get
();
error_log
(
$this
->
db
->
last_query
());
return
$query
->
result_array
();
}
...
...
application/views/backend/cms_track/list_track_view.php
View file @
3f52cb10
...
...
@@ -33,7 +33,7 @@
<!-- Lọc theo nguồn cung cấp nhạc -->
<div
class=
"col-lg-2"
>
<select
class=
"form-control"
name=
"fBySource"
id=
"fBySource"
>
<option
value=
""
>
Tất cả nguồn
</option>
<option
value=
""
>
- Tất cả nguồn -
</option>
<option
value=
"ZING"
>
Nguồn Zing
</option>
<option
value=
"NCT"
>
Nguồn NCT
</option>
<option
value=
"KEENG"
>
Nguồn Keeng
</option>
...
...
@@ -42,7 +42,7 @@
<!-- Lọc theo thông tin ca sĩ -->
<div
class=
"col-lg-2"
>
<select
class=
"form-control"
name=
"fBySinger"
id=
"fBySinger"
>
<option
value=
"-1"
>
Thông tin ca sĩ
</option>
<option
value=
"-1"
>
- Thông tin ca sĩ -
</option>
<option
value=
"1"
>
Đã cập nhật
</option>
<option
value=
"2"
>
Chưa cập nhật
</option>
</select>
...
...
@@ -50,11 +50,17 @@
<!-- Lọc theo thông tin nhạc sĩ -->
<div
class=
"col-lg-2"
>
<select
class=
"form-control"
name=
"fByComposer"
id=
"fByComposer"
>
<option
value=
"-1"
>
Thông tin nhạc sĩ
</option>
<option
value=
"-1"
>
- Thông tin nhạc sĩ -
</option>
<option
value=
"1"
>
Đã cập nhật
</option>
<option
value=
"2"
>
Chưa cập nhật
</option>
</select>
</div>
<div
class=
"col-lg-2"
>
<select
class=
"form-control"
name=
"fByBlacklist"
id=
"fByBlacklist"
>
<option
value=
"-1"
>
- Chặn lượt nghe -
</option>
<option
value=
"1"
>
Đã chặn
</option>
</select>
</div>
<!-- Xóa bộ lọc -->
<div
class=
"col-lg-1"
>
<button
class=
"btn btn-sm btn-default"
id=
"delete-filter"
>
Xóa bộ lọc
</button>
...
...
@@ -92,12 +98,14 @@ $(document).ready(function() {
loadDataByAjaxFromSelectBox
(
'fBySource'
,
url
);
loadDataByAjaxFromSelectBox
(
'fBySinger'
,
url
);
loadDataByAjaxFromSelectBox
(
'fByComposer'
,
url
);
loadDataByAjaxFromSelectBox
(
'fByBlacklist'
,
url
);
// Xóa bộ lọc
$
(
'#delete-filter'
).
click
(
function
()
{
$
(
"#input-name"
).
val
(
''
);
$
(
"#fBySinger"
).
val
(
'-1'
);
$
(
"#fByComposer"
).
val
(
'-1'
);
$
(
"#fByBlacklist"
).
val
(
'-1'
);
changePagination
(
'0'
);
return
false
;
...
...
@@ -138,12 +146,14 @@ function callAjax(pageId, url) {
var
fBySource
=
$
(
"#fBySource"
).
val
();
var
fBySinger
=
$
(
"#fBySinger"
).
val
();
var
fByComposer
=
$
(
"#fByComposer"
).
val
();
var
fByBlacklist
=
$
(
"#fByBlacklist"
).
val
();
var
dataReq
=
{
csrf_name
:
csrf_value
,
fByName
:
fByName
,
fBySource
:
fBySource
,
fBySinger
:
fBySinger
,
fByComposer
:
fByComposer
,
fByBlacklist
:
fByBlacklist
,
pageId
:
pageId
};
//Ajax
...
...
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