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
e89b5371
Commit
e89b5371
authored
Jun 08, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xuất excel
parent
2e93c476
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
NctController.php
app/Http/Controllers/Api/NctController.php
+22
-2
No files found.
app/Http/Controllers/Api/NctController.php
View file @
e89b5371
...
...
@@ -6,6 +6,7 @@ use App\Models\Track;
use
App\Repositories\TrackRepository
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
Maatwebsite\Excel\Facades\Excel
;
class
NctController
extends
Controller
{
...
...
@@ -83,7 +84,26 @@ class NctController extends Controller
}
$response
=
null
;
foreach
(
$tracks
as
$key
=>
$track
)
{
Excel
::
create
(
'weekly_report'
,
function
(
$excel
)
use
(
$tracks
){
$excel
->
sheet
(
'Sheetname'
,
function
(
$sheet
)
use
(
$tracks
){
// Sheet manipulation
foreach
(
$tracks
as
$key
=>
$val
)
{
$sheet
->
cell
(
'A'
.
(
$key
+
1
),
function
(
$cell
)
use
(
$val
){
// manipulate the cell
$cell
->
setValue
(
$val
[
'title'
]);
});
}
/*$sheet->cells('A1:A5', function($cells) {
// manipulate the range of cells
});*/
});
})
->
store
(
'xlsx'
,
storage_path
(
'exports/weekly_report'
));
/*foreach ($tracks as $key => $track) {
$link = null;
$duration = 0;
$check = $this->privateGeTrackLink($tracks_playlist, $track['id_nct']);
...
...
@@ -102,7 +122,7 @@ class NctController extends Controller
}
echo $track['title'] . "\t" . $track['id_nct'] . "\t" . $track['id_nct_str'] . "\t" . $track['singer'] . '<br>';
}
}
*/
die
();
...
...
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