|
|
@@ -12,6 +12,7 @@ use yii\filters\AccessControl; |
|
|
|
use kartik\mpdf\Pdf; |
|
|
|
use common\models\Etablissement; |
|
|
|
use common\models\Commande ; |
|
|
|
use common\models\CommandeAuto ; |
|
|
|
use common\models\Production ; |
|
|
|
|
|
|
|
/** |
|
|
@@ -133,6 +134,53 @@ class CronController extends BackendController |
|
|
|
|
|
|
|
$u->save(); |
|
|
|
} |
|
|
|
|
|
|
|
$commandes = Commande::find() |
|
|
|
->where('username IS NOT NULL') |
|
|
|
->all() ; |
|
|
|
|
|
|
|
foreach($commandes as $c) |
|
|
|
{ |
|
|
|
do { |
|
|
|
$i_nom = rand(0, count($arr_noms)-1) ; |
|
|
|
$i_prenom = rand(0, count($arr_prenoms)-1) ; |
|
|
|
} while(isset($arr_noms_checked[$i_nom]) || isset($arr_prenoms_checked[$i_prenom])) ; |
|
|
|
|
|
|
|
$arr_noms_checked[$i_nom] = true ; |
|
|
|
$arr_prenoms_checked[$i_prenom] = true ; |
|
|
|
|
|
|
|
$nom = $arr_noms[$i_nom] ; |
|
|
|
$prenom = $arr_prenoms[$i_prenom] ; |
|
|
|
|
|
|
|
|
|
|
|
$c->username = $prenom.' '.$nom ; |
|
|
|
|
|
|
|
$c->save() ; |
|
|
|
} |
|
|
|
|
|
|
|
$commandes_auto = CommandeAuto::find() |
|
|
|
->where('username IS NOT NULL') |
|
|
|
->all() ; |
|
|
|
|
|
|
|
foreach($commandes_auto as $c) |
|
|
|
{ |
|
|
|
do { |
|
|
|
$i_nom = rand(0, count($arr_noms)-1) ; |
|
|
|
$i_prenom = rand(0, count($arr_prenoms)-1) ; |
|
|
|
} while(isset($arr_noms_checked[$i_nom]) || isset($arr_prenoms_checked[$i_prenom])) ; |
|
|
|
|
|
|
|
$arr_noms_checked[$i_nom] = true ; |
|
|
|
$arr_prenoms_checked[$i_prenom] = true ; |
|
|
|
|
|
|
|
$nom = $arr_noms[$i_nom] ; |
|
|
|
$prenom = $arr_prenoms[$i_prenom] ; |
|
|
|
|
|
|
|
|
|
|
|
$c->username = $prenom.' '.$nom ; |
|
|
|
|
|
|
|
$c->save() ; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|