mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 21:44:09 +00:00
regenerate customers marking
This commit is contained in:
+15
-15
@@ -70,21 +70,21 @@ Route::get('/customer/{marking}', function ($marking) {
|
||||
Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download')->name('order.qr.download');
|
||||
|
||||
Route::get('/test', function(){
|
||||
dd(OldCompany::all());
|
||||
|
||||
// $companyConnections = CompanyConnection::all();
|
||||
// foreach ($companyConnections as $connection){
|
||||
// $company = $connection->invitee;
|
||||
// $oldCompany = OldCompany::where('name', 'LIKE', '%'.$company->name.'%')->first();
|
||||
// if ($oldCompany){
|
||||
// $marking = explode("CIEF/", $oldCompany->marking);
|
||||
// $marking = str_replace(' ', '', str_replace('/', '', $marking[1]));
|
||||
// $connection->invitee_reference = $marking;
|
||||
//
|
||||
// } else {
|
||||
// $connection->invitee_reference = mt_rand(1000, 9999).(new GeneratesInitials())->name($company->name)->length(3)->generate();
|
||||
// }
|
||||
//
|
||||
$companyConnections = CompanyConnection::all();
|
||||
foreach ($companyConnections as $connection){
|
||||
$company = $connection->invitee;
|
||||
$oldCompany = OldCompany::where('name', 'LIKE', '%'.$company->name.'%')->first();
|
||||
if ($oldCompany){
|
||||
$marking = explode("CIEF/", $oldCompany->marking);
|
||||
$marking = str_replace(' ', '', str_replace('/', '', $marking[1]));
|
||||
$connection->invitee_reference = $marking;
|
||||
|
||||
} else {
|
||||
$connection->invitee_reference = mt_rand(1000, 9999).(new GeneratesInitials())->name($company->name)->length(3)->generate();
|
||||
dump($connection->invitee_reference);
|
||||
}
|
||||
|
||||
// $connection->save();
|
||||
// }
|
||||
}
|
||||
})->name('test');
|
||||
Reference in New Issue
Block a user