Closed fung626 closed 6 years ago
set format with false, the total
is in res.data.song.totalnum
$data = $api->format(false)->search('Soldier', [
'page' => 1,
'limit' => 30
]);
{
"subcode" : 0,
"code" : 0,
"message" : "",
"tips" : "",
"notice" : "",
"data" : {
"totaltime" : 0,
"keyword" : "Soldier",
"song" : {
"curnum" : 1,
"totalnum" : 396,
"list" : [
{
...
}
],
"curpage" : 1
},
"priority" : 0,
"qc" : [],
"tab" : 0,
"semantic" : {
"list" : [],
"totalnum" : 0,
"curnum" : 0,
"curpage" : 1
},
"taglist" : []
}
}
How about the other sources ? Only netease return total
?
Try yourself without format 😆
thx for help :)
I want to setup a pagination search function in my application. And I have finished API part by follow your instruction
The data have successfully received. However, without the
total
I can't calculate the last page. Same as your NeteaseCloudMusicApi reposongCount
data.Also, I had reviewed Meting.php. And I found out there is a parameter call
total
in netease. By default set it to true, but I still can't get thetotal
.My question is how I get the
total
when run the search function? thanks in advance