last changes since 6-2023
This commit is contained in:
parent
0341c9c189
commit
04d677d37a
142 changed files with 7895 additions and 2855 deletions
|
|
@ -189,7 +189,6 @@ class CustomerController extends Controller
|
|||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
}
|
||||
|
||||
$data['faker_mail'] = isset($data['faker_mail']) ? true : false;
|
||||
$data['has_buyed'] = isset($data['has_buyed']) ? true : false;
|
||||
$data['subscribed'] = isset($data['subscribed']) ? true : false;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,16 @@
|
|||
|
||||
|
||||
namespace App\Http\Controllers\User;
|
||||
use Auth;
|
||||
use Request;
|
||||
use App\User;
|
||||
use App\Services\HTMLHelper;
|
||||
use App\Exports\UserTeamExport;
|
||||
use App\Models\UserSalesVolume;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Services\BusinessPlan\ExportBot;
|
||||
use App\Services\BusinessPlan\TreeCalcBot;
|
||||
use Auth;
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
|
|
@ -49,7 +52,6 @@ class TeamController extends Controller
|
|||
return view('user.team.structure', $data);
|
||||
}
|
||||
|
||||
|
||||
public function points()
|
||||
{
|
||||
$this->setFilterVars();
|
||||
|
|
@ -63,6 +65,69 @@ class TeamController extends Controller
|
|||
return view('user.team.points', $data);
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
|
||||
$user = User::find(\Auth::user()->id);
|
||||
$ExportBot = new ExportBot('member');
|
||||
$ExportBot->initStructureUser($user, 'list'); //tree or list
|
||||
$data = [
|
||||
'ExportBot' => $ExportBot,
|
||||
];
|
||||
return view('user.team.export', $data);
|
||||
}
|
||||
|
||||
public function userTeamExport(){
|
||||
|
||||
if(Request::get('action') === "export"){
|
||||
$user = User::find(\Auth::user()->id);
|
||||
$ExportBot = new ExportBot('member');
|
||||
$ExportBot->initStructureUser($user, 'list'); //tree or list
|
||||
$columns = [];
|
||||
$filename = "mivita-mein-team-export-".date('Y-m-d-H-i-s');
|
||||
$headers = array(
|
||||
'Line',
|
||||
'Level',
|
||||
'E-Mail',
|
||||
'Vorname',
|
||||
'Nachname',
|
||||
'Adresse',
|
||||
'Zusatz',
|
||||
'PLZ',
|
||||
'Ort',
|
||||
'Land',
|
||||
'Tel',
|
||||
'Mobil',
|
||||
'Geburtstag',
|
||||
'Account',
|
||||
'Account bis',
|
||||
'Sponsor',
|
||||
);
|
||||
if(isset($ExportBot->user_list->childs)){
|
||||
foreach ($ExportBot->user_list->childs as $child){
|
||||
$columns[] = array(
|
||||
'Line' => $child->line,
|
||||
'Level' => $child->level_name,
|
||||
'E-Mail' => $child->email,
|
||||
'Vorname' => $child->first_name,
|
||||
'Nachname' => $child->last_name,
|
||||
'Adresse' => $child->address,
|
||||
'Zusatz' => $child->address_2,
|
||||
'PLZ' => $child->zipcode,
|
||||
'Ort' => $child->city,
|
||||
'Land' => $child->country_id,
|
||||
'Tel' => $child->phone,
|
||||
'Mobil' => $child->mobil,
|
||||
'Geburtstag' => $child->birthday,
|
||||
'Account' => ($child->active_account == 1 ? 'JA' : 'NEIN'),
|
||||
'Account bis' => $child->payment_account_date,
|
||||
'Sponsor' => $child->sponsor_name,
|
||||
);
|
||||
}
|
||||
}
|
||||
return Excel::download(new UserTeamExport($columns, $headers), $filename.'.xls');
|
||||
}
|
||||
}
|
||||
|
||||
private function setFilterVars(){
|
||||
|
||||
|
|
@ -72,7 +137,6 @@ class TeamController extends Controller
|
|||
if(!session('team_user_filter_year')){
|
||||
session(['team_user_filter_year' => intval(date('Y'))]);
|
||||
}
|
||||
|
||||
if(!session('team_user_points_filter_month')){
|
||||
session(['team_user_points_filter_month' => intval(date('m'))]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue