Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crawler.vmusicchart.vn
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
crawler.vmusicchart.vn
Commits
14ae1b46
Commit
14ae1b46
authored
Apr 14, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cập nhật response Api/NctController.php
parent
af981060
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
Functions.php
app/Helpers/Functions.php
+18
-0
NctController.php
app/Http/Controllers/Api/NctController.php
+2
-0
No files found.
app/Helpers/Functions.php
View file @
14ae1b46
...
@@ -328,3 +328,21 @@ if (!function_exists('saveLogFile')) {
...
@@ -328,3 +328,21 @@ if (!function_exists('saveLogFile')) {
return
true
;
return
true
;
}
}
}
}
if
(
!
function_exists
(
'getWeekDateRange'
))
{
/**
* Hàm lấy ngày đầu tiên và cuối cùng của tuần
* @param $week
* @param $year
* @return mixed
*/
function
getWeekDateRange
(
$week
,
$year
,
$format
=
'd/m/Y'
,
$day_start
=
0
)
{
$dto
=
new
DateTime
();
$dto
->
setISODate
(
$year
,
$week
,
$day_start
);
// 0: CN
$ret
[
'week_start'
]
=
$dto
->
format
(
$format
);
$dto
->
modify
(
'+6 days'
);
$ret
[
'week_end'
]
=
$dto
->
format
(
$format
);
return
$ret
;
}
}
app/Http/Controllers/Api/NctController.php
View file @
14ae1b46
...
@@ -13,6 +13,7 @@ class NctController extends Controller
...
@@ -13,6 +13,7 @@ class NctController extends Controller
public
function
__construct
(
TrackRepository
$trackRepository
)
public
function
__construct
(
TrackRepository
$trackRepository
)
{
{
$this
->
trackRepository
=
$trackRepository
;
$this
->
trackRepository
=
$trackRepository
;
ini_set
(
'max_execution_time'
,
-
1
);
}
}
/**
/**
...
@@ -40,6 +41,7 @@ class NctController extends Controller
...
@@ -40,6 +41,7 @@ class NctController extends Controller
$response
[]
=
$track
;
$response
[]
=
$track
;
$response
[
$key
][
'link'
]
=
$link
;
$response
[
$key
][
'link'
]
=
$link
;
$response
[
$key
][
'duration'
]
=
$duration
;
$response
[
$key
][
'duration'
]
=
$duration
;
$response
[
$key
][
'str_duration'
]
=
gmdate
(
'i:s'
,
$duration
);
}
}
return
response
()
->
json
([
return
response
()
->
json
([
...
...
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