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
cbb93d1a
Commit
cbb93d1a
authored
Mar 12, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cập nhật lọc ca sĩ và nhạc sĩ
parent
d4b1a742
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
CmsTrack.php
application/controllers/backend/CmsTrack.php
+2
-2
Track_model.php
application/models/Track_model.php
+22
-2
No files found.
application/controllers/backend/CmsTrack.php
View file @
cbb93d1a
...
...
@@ -41,9 +41,9 @@ class CmsTrack extends CI_Controller
$limit
=
100
;
$offset
=
(
$pageId
-
1
)
*
$limit
;
$data
[
'offset'
]
=
(
$pageId
-
1
)
*
$limit
;
$totalRecord
=
$this
->
track_model
->
cmsCountAll
(
$fByName
);
$totalRecord
=
$this
->
track_model
->
cmsCountAll
(
$fByName
,
$fBySinger
,
$fByComposer
);
$data
[
'pagination'
]
=
MyHelper
::
genPaginationLink
(
$totalRecord
,
$limit
,
$pageId
);
$data
[
'listData'
]
=
$this
->
track_model
->
cmsGetPagination
(
$limit
,
$offset
,
$fByName
);
$data
[
'listData'
]
=
$this
->
track_model
->
cmsGetPagination
(
$limit
,
$offset
,
$fByName
,
$fBySinger
,
$fByComposer
);
//
$this
->
load
->
view
(
'backend/ajax/cms_track/list_track_view'
,
$data
);
}
...
...
application/models/Track_model.php
View file @
cbb93d1a
...
...
@@ -128,7 +128,7 @@ class Track_model extends CI_Model
return
$query
->
result_array
();
}
public
function
cmsCountAll
(
$name
=
null
)
public
function
cmsCountAll
(
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
)
{
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
...
...
@@ -138,6 +138,16 @@ class Track_model extends CI_Model
$this
->
db
->
or_like
(
'slug'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tag'
,
$name
,
'both'
);
}
if
(
$fBySinger
==
1
)
{
$this
->
db
->
where
(
'singer_list is NOT NULL'
,
null
,
false
);
}
else
if
(
$fBySinger
==
2
)
{
$this
->
db
->
where
(
'singer_list'
,
null
);
}
if
(
$fByComposer
==
1
)
{
$this
->
db
->
where
(
'composer_list is NOT NULL'
,
null
,
false
);
}
else
if
(
$fByComposer
==
2
)
{
$this
->
db
->
where
(
'composer_list'
,
null
);
}
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
if
(
$result
)
{
...
...
@@ -172,7 +182,7 @@ class Track_model extends CI_Model
return
$query
->
result_array
();
}
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
)
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
,
$fBySinger
=
null
,
$fByComposer
=
null
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
...
...
@@ -182,6 +192,16 @@ class Track_model extends CI_Model
$this
->
db
->
or_like
(
'tracks.slug'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.tag'
,
$name
,
'both'
);
}
if
(
$fBySinger
==
1
)
{
$this
->
db
->
where
(
'singer_list is NOT NULL'
,
null
,
false
);
}
else
if
(
$fBySinger
==
2
)
{
$this
->
db
->
where
(
'singer_list'
,
null
);
}
if
(
$fByComposer
==
1
)
{
$this
->
db
->
where
(
'composer_list is NOT NULL'
,
null
,
false
);
}
else
if
(
$fByComposer
==
2
)
{
$this
->
db
->
where
(
'composer_list'
,
null
);
}
$this
->
db
->
order_by
(
$this
->
_table
.
'.title'
,
'asc'
);
$this
->
db
->
limit
(
$record
,
$start
);
$query
=
$this
->
db
->
get
();
...
...
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