浏览代码

Ajout du champs "default" au modèle PointSale

refactoring
父节点
当前提交
924f50f70d
共有 2 个文件被更改,包括 19 次插入2 次删除
  1. +4
    -2
      common/models/PointSale.php
  2. +15
    -0
      console/migrations/m190220_073434_ajout_champs_point_vente_defaut.php

+ 4
- 2
common/models/PointSale.php 查看文件

@@ -51,6 +51,7 @@ use common\components\ActiveRecordCommon ;
* @property string $name
* @property string $address
* @property integer $id_producer
* @property integer $default
*/
class PointSale extends ActiveRecordCommon
{
@@ -83,7 +84,7 @@ class PointSale extends ActiveRecordCommon
'infos_saturday', 'infos_sunday','credit_functioning'], 'string'],
[['point_production', 'credit', 'delivery_monday', 'delivery_tuesday',
'delivery_wednesday', 'delivery_thursday', 'delivery_friday',
'delivery_saturday', 'delivery_sunday'], 'boolean'],
'delivery_saturday', 'delivery_sunday','default'], 'boolean'],
['point_production', 'default', 'value' => 0],
['id_producer', 'integer'],
['id_producer', 'required'],
@@ -119,7 +120,8 @@ class PointSale extends ActiveRecordCommon
'delivery_saturday' => 'Samedi',
'delivery_sunday' => 'Dimanche',
'code' => 'Code',
'credit_functioning' => 'Utilisation du Crédit par l\'utilisateur'
'credit_functioning' => 'Utilisation du Crédit par l\'utilisateur',
'default' => 'Point de vente par défaut',
];
}


+ 15
- 0
console/migrations/m190220_073434_ajout_champs_point_vente_defaut.php 查看文件

@@ -0,0 +1,15 @@
<?php

use yii\db\Migration;
use yii\db\mysql\Schema;

class m190220_073434_ajout_champs_point_vente_defaut extends Migration {

public function up() {
$this->addColumn('point_sale', 'default', Schema::TYPE_BOOLEAN) ;
}

public function down() {
$this->dropColumn('point_sale', 'default') ;
}
}

正在加载...
取消
保存