Ce champs permet de détecter les commandes qui doivent être débitées automatiquement via une tâche cron le jour J.dev
* @property string $date_update | * @property string $date_update | ||||
* @property integer $id_point_vente | * @property integer $id_point_vente | ||||
* @property integer $id_production | * @property integer $id_production | ||||
* @property boolean $paiement_automatique | |||||
*/ | */ | ||||
class Commande extends \yii\db\ActiveRecord { | class Commande extends \yii\db\ActiveRecord { | ||||
$commande->type = Commande::TYPE_AUTO; | $commande->type = Commande::TYPE_AUTO; | ||||
$commande->id_point_vente = $this->id_point_vente; | $commande->id_point_vente = $this->id_point_vente; | ||||
$commande->id_production = $production->id; | $commande->id_production = $production->id; | ||||
$commande->paiement_automatique = $this->paiement_automatique ; | |||||
$point_vente_user = PointVenteUser::find() | $point_vente_user = PointVenteUser::find() | ||||
->where(['id_point_vente' => $this->id_point_vente, 'id_user' => $this->id_user]) | ->where(['id_point_vente' => $this->id_point_vente, 'id_user' => $this->id_user]) | ||||
->one(); | ->one(); |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
class m180315_090156_add_champs_commande_paiement_auto extends Migration { | |||||
public function up() { | |||||
$this->addColumn('commande', 'paiement_automatique', Schema::TYPE_BOOLEAN.' DEFAULT 0') ; | |||||
} | |||||
public function down() { | |||||
$this->dropColumn('commande', 'paiement_automatique') ; | |||||
} | |||||
} |