mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
Readme add Telegram
This commit is contained in:
@@ -12,6 +12,7 @@ use App\Models\SearchBox;
|
||||
use App\Models\Snatch;
|
||||
use App\Models\User;
|
||||
use App\Repositories\ExamRepository;
|
||||
use App\Repositories\HitAndRunRepository;
|
||||
use App\Repositories\SearchBoxRepository;
|
||||
use App\Repositories\TorrentRepository;
|
||||
use App\Repositories\UserRepository;
|
||||
@@ -57,7 +58,8 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = User::query()->first()->seed_points;
|
||||
$rep = new HitAndRunRepository();
|
||||
$r = $rep->getStatusStats(1)->get(2);
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
@@ -239,4 +239,23 @@ class HitAndRunRepository extends BaseRepository
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getStatusStats($uid, $formatted = true)
|
||||
{
|
||||
$results = HitAndRun::query()->where('uid', $uid)
|
||||
->selectRaw('status, count(*) as counts')
|
||||
->groupBy('status')
|
||||
->get()
|
||||
->pluck('counts', 'status');
|
||||
if ($formatted) {
|
||||
return sprintf(
|
||||
'%s/%s/%s',
|
||||
$results->get(HitAndRun::STATUS_INSPECTING, 0),
|
||||
$results->get(HitAndRun::STATUS_UNREACHED, 0),
|
||||
Setting::get('hr.ban_user_when_counts_reach')
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user