mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update
This commit is contained in:
parent
969762b98c
commit
fdf63813df
67
app/Console/Commands/SystemCache.php
Normal file
67
app/Console/Commands/SystemCache.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Utils\Helper;
|
||||||
|
use App\Models\Order;
|
||||||
|
use Illuminate\Support\Facades\Redis;
|
||||||
|
|
||||||
|
class SystemCache extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'system:cache';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '系统缓存任务';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$this->setMonthIncome();
|
||||||
|
$this->setMonthRegisterTotal();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setMonthIncome() {
|
||||||
|
Redis::set(
|
||||||
|
'getMonthIncome',
|
||||||
|
Order::where('created_at', '>', strtotime(date('Y-m-1')))
|
||||||
|
->where('created_at', '>', time())
|
||||||
|
->where('status', '3')
|
||||||
|
->where('callback_no', '!=', NULL)
|
||||||
|
->sum('total_amount')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setMonthRegisterTotal() {
|
||||||
|
Redis::set(
|
||||||
|
'getMonthRegisterTotal',
|
||||||
|
User::where('created_at', '>', strtotime(date('Y-m-1')))
|
||||||
|
->where('created_at', '>', time())
|
||||||
|
->count()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -24,11 +24,14 @@ class Kernel extends ConsoleKernel
|
|||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
|
// check order
|
||||||
$schedule->command('check:order')->everyMinute();
|
$schedule->command('check:order')->everyMinute();
|
||||||
|
// check expire
|
||||||
$schedule->command('check:expire')->everyMinute();
|
$schedule->command('check:expire')->everyMinute();
|
||||||
|
// check commission
|
||||||
$schedule->command('check:commission')->everyMinute();
|
$schedule->command('check:commission')->everyMinute();
|
||||||
// $schedule->command('inspire')
|
// system cache
|
||||||
// ->hourly();
|
$schedule->command('system:cache')->everyMinute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
18
app/Http/Controllers/Admin/StatController.php
Normal file
18
app/Http/Controllers/Admin/StatController.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\Admin\ServerSave;
|
||||||
|
use App\Http\Requests\Admin\ServerUpdate;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\ServerGroup;
|
||||||
|
use App\Models\Server;
|
||||||
|
use App\Models\Plan;
|
||||||
|
use App\Models\User;
|
||||||
|
|
||||||
|
class StatController extends Controller
|
||||||
|
{
|
||||||
|
public function dashboard (Request $request) {
|
||||||
|
}
|
||||||
|
}
|
2
public/p__admin__commission.async.js
vendored
2
public/p__admin__commission.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__config__payment.async.js
vendored
2
public/p__admin__config__payment.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__config__system.async.js
vendored
2
public/p__admin__config__system.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__dashboard.async.js
vendored
2
public/p__admin__dashboard.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__order.async.js
vendored
2
public/p__admin__order.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__plan.async.js
vendored
2
public/p__admin__plan.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__server.async.js
vendored
2
public/p__admin__server.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__server__group.async.js
vendored
2
public/p__admin__server__group.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__admin__user.async.js
vendored
2
public/p__admin__user.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__dashboard.async.js
vendored
2
public/p__dashboard.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__index.async.js
vendored
2
public/p__index.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__invite.async.js
vendored
2
public/p__invite.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__order.async.js
vendored
2
public/p__order.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__order__$trade_no.async.js
vendored
2
public/p__order__$trade_no.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__plan.async.js
vendored
2
public/p__plan.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__plan__$plan_id.async.js
vendored
2
public/p__plan__$plan_id.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__profile.async.js
vendored
2
public/p__profile.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__subscribe.async.js
vendored
2
public/p__subscribe.async.js
vendored
File diff suppressed because one or more lines are too long
2
public/p__tutorial.async.js
vendored
2
public/p__tutorial.async.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user