Commit 14ae1b46 by Phạm Văn Đoan

cập nhật response Api/NctController.php

parent af981060
...@@ -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;
}
}
...@@ -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([
......
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