mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
new feature: claim
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Repositories\ClaimRepository;
|
||||
use App\Repositories\ExamRepository;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ClaimSettle extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'claim:settle {--uid=} {--force=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Claim settle, options: --uid, --force';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new ClaimRepository();
|
||||
$uid = $this->option('uid');
|
||||
$force = $this->option('force');
|
||||
$test = $this->option('test');
|
||||
$this->info(sprintf('uid: %s, force: %s, test: %s', $uid, $force, $test));
|
||||
if (!$uid) {
|
||||
$result = $rep->settleCronjob();
|
||||
} else {
|
||||
$result = $rep->settleUser($uid, $force, $test);
|
||||
}
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -126,11 +126,9 @@ class Test extends Command
|
||||
// $r = $rep->getContinuousDays($attendance);
|
||||
// $r = $rep->getContinuousPoints(11);
|
||||
|
||||
$database = nexus_env('GEOIP2_DATABASE');
|
||||
$reader = new \GeoIp2\Database\Reader($database);
|
||||
$city = $reader->city("95.211.156.168");
|
||||
$r = $city->country;
|
||||
dd($r);
|
||||
$arr = [1,2];
|
||||
$r = collect($arr)->map(fn($item) => $item * 2)->implode(',');
|
||||
dd($r, $arr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user