Commit 0a48c48f by Phạm Văn Đoan

tích hợp lấy data từ elasticsearch

parent dcdfb3f6
......@@ -358,9 +358,9 @@ class CmsRanking extends CI_Controller
// Ghi log
$this->actionlog_model->add('SHOW_HISTORY', 'Xem lịch sử lượt nghe', null, null, $track_id);
$histories = $this->crawler_listen_history_model->getByTrackId($track_id);
$data = [];
$histories = $this->crawler_listen_history_model->getByTrackId($track_id);
if ($histories) {
foreach ($histories as $key => $track) {
$data[$key]['date'] = $track['date_log'];
......@@ -370,24 +370,8 @@ class CmsRanking extends CI_Controller
}
}
/*$histories_view = $this->crawler_listen_history_model->getByTrackIdFromView($track_id);
$date_list = $histories_view[0]['date_log_list'];
$zing_list = $histories_view[0]['zing_count_list'];
$nct_list = $histories_view[0]['nct_count_list'];
$keeng_list = $histories_view[0]['keeng_count_list'];
//
$array_date = explode(',', $date_list);
$array_zing = explode(',', $zing_list);
$array_nct = explode(',', $nct_list);
$array_keeng = explode(',', $keeng_list);
//
$data = [];
foreach ($array_date as $key => $val) {
$data[$key]['date'] = $val;
$data[$key]['zing'] = intval($array_zing[$key]);
$data[$key]['nct'] = intval($array_nct[$key]);
$data[$key]['keeng'] = intval($array_keeng[$key]);
}*/
/*$url = 'http://edupham.com/api/v1/vmusicchart/get-listen-history-by-track-id?track_id=1644&type=chart';
$data = file_get_contents($url);*/
$response['response'] = $data;
$response['track_title'] = $track_title;
......
......@@ -19,6 +19,7 @@
// Add data
//chart.data = generateChartData();
//chart.data = <?php //echo ($response) ?>;
chart.data = <?php echo json_encode($response) ?>;
// Create axes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment