no message
This commit is contained in:
parent
ee894878f9
commit
c0f23e8f86
@ -65,8 +65,8 @@ $oHttp->aData['message']['text'] = '\/user#find 1';
|
||||
|
||||
$oHttp->aData['message']['text'] = '\/cmd#list';
|
||||
$oHttp->aData['message']['text'] = '\/visitor#all';
|
||||
$oHttp->aData['message']['text'] = '\/user#report__day';
|
||||
$oHttp->aData['message']['text'] = '\/user#countReg__date__2021-03-28__2028-03-28';
|
||||
//$oHttp->aData['message']['text'] = '\/user#report__day';
|
||||
//$oHttp->aData['message']['text'] = '\/user#countReg__date__2021-03-28__2028-03-28';
|
||||
|
||||
//{
|
||||
// "update_id": 761180998,
|
||||
|
||||
@ -14,11 +14,24 @@ final class Visitor
|
||||
{
|
||||
$aVisitors = ModelVisitor::select('from', DB::raw('count(*) as total'))
|
||||
->groupBy('from')
|
||||
->orderBy('total', 'desc') // 按 total 降序排序
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
return json_encode($aVisitors, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
$sPre = "\n\n---------------------------";
|
||||
|
||||
$sMsg = '';
|
||||
$iTotalCount = 0;
|
||||
foreach ($aVisitors as $row) {
|
||||
$sMsg .= "\n\n" . $row['from'] . ":" . $row['total'];
|
||||
$iTotalCount += $row['total'] ?? 0;
|
||||
}
|
||||
|
||||
$sTotal = "\n\n总数:".$row['total'];
|
||||
|
||||
$str = $sPre.$sTotal.$sMsg.$sPre;
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user