51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
namespace App\Services\SyS;
|
|
|
|
use App\Cron\BusinessUsersStore;
|
|
use Carbon;
|
|
use Request;
|
|
use App\Models\SySetting;
|
|
|
|
class BusinessStructur
|
|
{
|
|
|
|
public static function show()
|
|
{
|
|
$month = 2;
|
|
$year = 2021;
|
|
dd("function on: php artisan business:store month year");
|
|
|
|
/*$businessUsersStore = new BusinessUsersStore($month, $year);
|
|
$businessUsersStore->storeUserBusinessStructure();
|
|
$businessUsersStore->storeBusinessUsersDetail();
|
|
$businessUsersStore->storeBusinessCompleted();*/
|
|
|
|
|
|
$data = [
|
|
'year' => $year,
|
|
'month' => $month,
|
|
];
|
|
|
|
return view('sys.tools.business_structur', $data);
|
|
}
|
|
|
|
|
|
public static function store()
|
|
{
|
|
|
|
$data = Request::all();
|
|
|
|
$data['active'] = isset($data['active']) ? true : false;
|
|
if($data['id'] === "new"){
|
|
$model = SySetting::create($data);
|
|
}else{
|
|
$model = SySetting::find($data['id']);
|
|
$model->fill($data);
|
|
$model->save();
|
|
}
|
|
|
|
\Session()->flash('alert-save', '1');
|
|
return redirect(route('sysadmin_tool', ['sales_members']));
|
|
|
|
}
|
|
}
|