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
39f3f1b9
Commit
39f3f1b9
authored
Sep 02, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug thiếu data để xử lý
parent
bc1a2192
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
14 deletions
+58
-14
CmsRanking.php
application/controllers/backend/CmsRanking.php
+46
-10
overlap_ranking_view.php
...n/views/backend/ajax/cms_setting/overlap_ranking_view.php
+7
-1
js_process_report.php
.../views/backend/cms_ranking/partials/js_process_report.php
+5
-3
No files found.
application/controllers/backend/CmsRanking.php
View file @
39f3f1b9
...
...
@@ -11,6 +11,8 @@ include FCPATH . "/application/third_party/PHPExcel.php";
class
CmsRanking
extends
CI_Controller
{
protected
$overlap_ranking_list
=
'backend/cmsSetting/overlapRanking'
;
public
function
__construct
()
{
parent
::
__construct
();
...
...
@@ -414,6 +416,9 @@ class CmsRanking extends CI_Controller
*/
public
function
reportOverlappingAjax
()
{
$time
=
$this
->
input
->
post
(
'time'
);
$scope
=
$this
->
input
->
post
(
'scope'
);
//
$keep_ranking
=
$this
->
input
->
post
(
'keep_ranking'
);
$keep_track_id
=
$this
->
input
->
post
(
'keep_track_id'
);
$keep_track_title
=
$this
->
input
->
post
(
'keep_track_title'
);
...
...
@@ -422,11 +427,38 @@ class CmsRanking extends CI_Controller
$delete_track_id
=
$this
->
input
->
post
(
'delete_track_id'
);
$delete_track_title
=
$this
->
input
->
post
(
'delete_track_title'
);
//
$scope
=
$this
->
input
->
post
(
'scope'
);
//
if
(
$delete_track_id
>
0
)
{
if
(
$delete_track_id
>
0
&&
in_array
(
$scope
,
[
'DAILY'
,
'WEEKLY'
,
'MONTHLY'
]))
{
$date
=
null
;
$week
=
null
;
$month
=
null
;
$year
=
null
;
switch
(
$scope
)
{
case
'DAILY'
:
$time
=
str_replace
(
'/'
,
'-'
,
trim
(
$time
));
$date
=
date
(
'Y-m-d'
,
strtotime
(
$time
));
break
;
case
'WEEKLY'
:
$time
=
explode
(
'-'
,
$time
);
if
(
count
(
$time
)
==
2
)
{
$week
=
trim
(
$time
[
0
]);
$year
=
trim
(
$time
[
1
]);
}
break
;
case
'MONTHLY'
:
$time
=
explode
(
'-'
,
$time
);
if
(
count
(
$time
)
==
2
)
{
$month
=
trim
(
$time
[
0
]);
$year
=
trim
(
$time
[
1
]);
}
break
;
default
:
}
$data_insert
=
[
'scope'
=>
$scope
,
'date'
=>
$date
,
'week'
=>
$week
,
'month'
=>
$month
,
'year'
=>
$year
,
'keep_ranking'
=>
$keep_ranking
,
'keep_track_id'
=>
$keep_track_id
,
'keep_track_title'
=>
trim
(
$keep_track_title
),
...
...
@@ -456,8 +488,8 @@ class CmsRanking extends CI_Controller
}
}
else
{
echo
json_encode
([
'code'
=>
4
00
,
'message'
=>
'Không thành công'
,
'code'
=>
4
22
,
'message'
=>
'Không thành công
, lỗi tham số truyền lên
'
,
'data'
=>
null
]);
}
...
...
@@ -467,13 +499,17 @@ class CmsRanking extends CI_Controller
* Hàm xử lý trùng BXH
* @param $id
*/
public
function
processOverlapRanking
(
$id
)
public
function
processOverlapRanking
(
$id
,
$scope
)
{
$overlap
=
$this
->
report_violation_model
->
getById
(
$id
,
0
);
if
(
isset
(
$overlap
[
0
]))
{
print_r
(
$overlap
);
if
(
in_array
(
$scope
,
[
'DAILY'
,
'WEEKLY'
,
'MONTHLY'
]))
{
$overlap
=
$this
->
report_violation_model
->
getById
(
$id
,
0
);
if
(
isset
(
$overlap
[
0
]))
{
print_r
(
$overlap
);
}
else
{
redirect
(
base_url
(
$this
->
overlap_ranking_list
));
}
}
else
{
redirect
(
base_url
(
$this
->
overlap_ranking_list
));
}
}
...
...
application/views/backend/ajax/cms_setting/overlap_ranking_view.php
View file @
39f3f1b9
...
...
@@ -4,6 +4,7 @@
<tr>
<th
style=
"text-align: center"
>
STT
</th>
<th
style=
"text-align: center"
>
Nguồn BXH
</th>
<th
style=
"text-align: center"
>
Thời gian
</th>
<th
style=
"text-align: center"
>
Ranking - Bài hát đúng - ID
</th>
<th
style=
"text-align: center"
>
Ranking - Bài hát trùng / muốn gỡ bỏ - ID
</th>
<th
style=
"text-align: center"
>
Trạng thái
</th>
...
...
@@ -15,6 +16,11 @@
<tr>
<td
style=
"text-align: center"
>
<?php
echo
(
$key
+
1
+
$offset
);
?>
</td>
<td
style=
"text-align: center"
>
<?php
echo
$data
[
'scope'
];
?>
</td>
<td
style=
"text-align: center"
>
<?php
echo
(
$data
[
'scope'
]
==
'DAILY'
&&
!
empty
(
$data
[
'date'
]))
?
date
(
'd/m/Y'
,
strtotime
(
$data
[
'date'
]))
:
''
;
?>
<?php
echo
(
$data
[
'scope'
]
==
'WEEKLY'
)
?
$data
[
'week'
]
.
'/'
.
$data
[
'year'
]
:
''
;
?>
<?php
echo
(
$data
[
'scope'
]
==
'MONTHLY'
)
?
$data
[
'month'
]
.
'/'
.
$data
[
'year'
]
:
''
;
?>
</td>
<td
style=
"text-align: left"
>
<?php
echo
$data
[
'keep_track_title'
];
?>
</td>
...
...
@@ -26,7 +32,7 @@
</td>
<td
style=
"text-align: center"
>
<?php
if
(
$data
[
'status'
]
==
0
)
:
?>
<a
href=
"
<?php
echo
base_url
(
'backend/cmsRanking/processOverlapRanking/'
.
$data
[
'id'
]);
?>
"
title=
"Xử lý xóa trùng"
>
<a
href=
"
<?php
echo
base_url
(
'backend/cmsRanking/processOverlapRanking/'
.
$data
[
'id'
]
.
'/'
.
$data
[
'scope'
]
);
?>
"
title=
"Xử lý xóa trùng"
>
<i
class=
"ace-icon fa fa-trash bigger-130 color-red"
></i>
</a>
<?php
endif
;
?>
...
...
application/views/backend/cms_ranking/partials/js_process_report.php
View file @
39f3f1b9
...
...
@@ -56,14 +56,14 @@
url
:
'
<?php
echo
base_url
(
"backend/cmsRanking/reportOverlappingAjax"
);
?>
'
,
data
:
{
csrf_name
:
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
,
fByName
:
(
$
(
"#input-date-picker"
).
val
())
?
$
(
"#input-date-picker"
).
val
()
:
null
,
time
:
(
$
(
"#input-date-picker"
).
val
())
?
$
(
"#input-date-picker"
).
val
()
:
null
,
scope
:
'
<?php
echo
(
isset
(
$tags
)
?
$tags
:
'DAILY'
)
?>
'
,
keep_ranking
:
keep_ranking
,
keep_track_id
:
keep_track_id
,
keep_track_title
:
(
keep_track_title
)
?
keep_track_title
.
trim
()
:
keep_track_title
,
delete_ranking
:
delete_ranking
,
delete_track_id
:
delete_track_id
,
delete_track_title
:
(
delete_track_title
)
?
delete_track_title
.
trim
()
:
delete_track_title
,
scope
:
'
<?php
echo
(
isset
(
$tags
)
?
$tags
:
'DAILY'
)
?>
'
},
dataType
:
"JSON"
,
cache
:
false
,
...
...
@@ -73,7 +73,9 @@
//
}
else
{}
},
error
:
function
()
{}
error
:
function
()
{
$
(
'#modal-overlapping-ranking'
).
modal
(
'hide'
);
}
});
}
else
{
alert
(
'Hai bài hát phải khác nhau!'
)
...
...
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