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
ad6be874
Commit
ad6be874
authored
Mar 13, 2020
by
Trần Văn Minh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Thêm slug khi thêm mới
parent
bf846aa6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
CmsTrack.php
application/controllers/backend/CmsTrack.php
+3
-0
Track_model.php
application/models/Track_model.php
+5
-5
No files found.
application/controllers/backend/CmsTrack.php
View file @
ad6be874
...
@@ -135,6 +135,7 @@ class CmsTrack extends CI_Controller
...
@@ -135,6 +135,7 @@ class CmsTrack extends CI_Controller
}
}
}
}
//Thêm bài hát mới
public
function
addTrack
()
public
function
addTrack
()
{
{
$this
->
_data
[
'list_user'
]
=
$list_user
=
$this
->
track_model
->
getListUsers
();
$this
->
_data
[
'list_user'
]
=
$list_user
=
$this
->
track_model
->
getListUsers
();
...
@@ -196,6 +197,7 @@ class CmsTrack extends CI_Controller
...
@@ -196,6 +197,7 @@ class CmsTrack extends CI_Controller
$nct_id
=
$this
->
input
->
post
(
'nct_id'
);
$nct_id
=
$this
->
input
->
post
(
'nct_id'
);
if
(
$title
){
if
(
$title
){
$slug
=
MyHelper
::
genSlug
(
$title
);
$dataUpdate
=
array
(
$dataUpdate
=
array
(
'title'
=>
$title
,
'title'
=>
$title
,
'userid'
=>
$artist
,
'userid'
=>
$artist
,
...
@@ -203,6 +205,7 @@ class CmsTrack extends CI_Controller
...
@@ -203,6 +205,7 @@ class CmsTrack extends CI_Controller
'link_nct'
=>
(
$source
==
'nct'
)
?
$link
:
''
,
'link_nct'
=>
(
$source
==
'nct'
)
?
$link
:
''
,
'link_keeng'
=>
(
$source
==
'keeng'
)
?
$link
:
''
,
'link_keeng'
=>
(
$source
==
'keeng'
)
?
$link
:
''
,
'id_nct'
=>
$nct_id
,
'id_nct'
=>
$nct_id
,
'slug'
=>
$slug
,
'tag'
=>
'vmusic'
,
'tag'
=>
'vmusic'
,
'genre'
=>
1
,
'genre'
=>
1
,
'time'
=>
time
()
'time'
=>
time
()
...
...
application/models/Track_model.php
View file @
ad6be874
...
@@ -84,11 +84,11 @@ class Track_model extends CI_Model
...
@@ -84,11 +84,11 @@ class Track_model extends CI_Model
}
}
if
(
$active
==
'insert'
)
{
if
(
$active
==
'insert'
)
{
$this
->
db
->
set
(
'track_id'
,
$id_track
);
$this
->
db
->
set
(
'track_id'
,
$id_track
);
$this
->
db
->
insert
(
'track_user'
);
$this
->
db
->
insert
(
$this
->
track_user
);
}
else
{
}
else
{
$this
->
db
->
where
(
'track_id'
,
$id_track
);
$this
->
db
->
where
(
'track_id'
,
$id_track
);
$this
->
db
->
where
(
'id'
,
$id
);
$this
->
db
->
where
(
'id'
,
$id
);
$this
->
db
->
update
(
'track_user'
);
$this
->
db
->
update
(
$this
->
track_user
);
}
}
}
}
...
@@ -99,7 +99,7 @@ class Track_model extends CI_Model
...
@@ -99,7 +99,7 @@ class Track_model extends CI_Model
track_artists.name AS artist,
track_artists.name AS artist,
track_artists.id AS id_track_artist'
);
track_artists.id AS id_track_artist'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
join
(
'track_user'
,
'track_user.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
track_user
,
'track_user.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
track_artists
,
'track_artists.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
track_artists
,
'track_artists.track_id = tracks.id'
,
'left'
);
$this
->
db
->
where
(
$this
->
_table
.
'.id'
,
$id
);
$this
->
db
->
where
(
$this
->
_table
.
'.id'
,
$id
);
$query
=
$this
->
db
->
get
();
$query
=
$this
->
db
->
get
();
...
@@ -166,7 +166,7 @@ class Track_model extends CI_Model
...
@@ -166,7 +166,7 @@ class Track_model extends CI_Model
track_user.name AS singer_name2, track_user.id AS id_user,
track_user.name AS singer_name2, track_user.id AS id_user,
track_artists.name AS composer_name2, track_artists.id AS id_artist'
);
track_artists.name AS composer_name2, track_artists.id AS id_artist'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
join
(
'track_user'
,
'track_user.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
track_user
,
'track_user.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
track_artists
,
'track_artists.track_id = tracks.id'
,
'left'
);
$this
->
db
->
join
(
$this
->
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 u1'
,
'u1.id = track_user.user_id'
,
'left'
);
$this
->
db
->
join
(
'users u2'
,
'u2.id = track_artists.user_id'
,
'left'
);
$this
->
db
->
join
(
'users u2'
,
'u2.id = track_artists.user_id'
,
'left'
);
...
@@ -263,7 +263,7 @@ class Track_model extends CI_Model
...
@@ -263,7 +263,7 @@ class Track_model extends CI_Model
//if ($query) $users = $query->result_array();
//if ($query) $users = $query->result_array();
//return $users;
//return $users;
$this
->
db
->
from
(
'track_user'
);
$this
->
db
->
from
(
$this
->
track_user
);
$this
->
db
->
where
(
'track_id ='
,
$track_id
);
$this
->
db
->
where
(
'track_id ='
,
$track_id
);
$query
=
$this
->
db
->
get
();
$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