#51 Festschreiben der Points, Gutschriftenmodul
This commit is contained in:
parent
dfd049aaa9
commit
3f2fbd6d5b
63 changed files with 4610 additions and 971 deletions
78
app/Console/Commands/BusinessStore.php
Normal file
78
app/Console/Commands/BusinessStore.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Console\Command;
|
||||
use App\Cron\BusinessUsersStore;
|
||||
|
||||
class BusinessStore extends Command
|
||||
{
|
||||
/**
|
||||
* php artisan business:store month year
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'business:store {month} {year}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create Business Structur and UserDetails';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$day = (int) Setting::getContentBySlug('day-exectute-business-structur');
|
||||
$this->info('RUN Command BusinessStore on Day '. $day);
|
||||
|
||||
$timeStart = microtime(true);
|
||||
$this->info('RUN Command BusinessStore');
|
||||
|
||||
$month = $this->argument('month');
|
||||
$year = $this->argument('year');
|
||||
if(!$month || !$year){
|
||||
$this->info('need arguments month & year');
|
||||
return 0;
|
||||
}
|
||||
|
||||
//$this->info('month: '.$month.' year:'.$year);
|
||||
for($i = 1; $i<=6; $i++){
|
||||
$month = $i;
|
||||
$this->info('month: '.$month.' year:'.$year);
|
||||
$businessUsersStore = new BusinessUsersStore($month, $year);
|
||||
$businessUsersStore->storeUserBusinessStructure();
|
||||
$businessUsersStore->storeBusinessUsersDetail();
|
||||
$bool = $businessUsersStore->storeBusinessCompleted();
|
||||
|
||||
$diff = microtime(true) - $timeStart;
|
||||
$sec = intval($diff);
|
||||
$micro = $diff - $sec;
|
||||
$this->info('BusinessStore: '.$bool. ' | Time: '.$sec. 'sec :' . round($micro * 1000, 4) . " ms");
|
||||
|
||||
}
|
||||
|
||||
|
||||
//$this->info('END Command BusinessStore: '.$bool. ' | Time: '.$sec. 'sec :' . round($micro * 1000, 4) . " ms");
|
||||
|
||||
// \Log::info('Cron is running');
|
||||
//return 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue