소스 검색

Ajout des options "credit_limit" et "use_credit_checked_default"

refactoring
부모
커밋
b0389fabf9
3개의 변경된 파일35개의 추가작업 그리고 3개의 파일을 삭제
  1. +10
    -0
      backend/views/producer/update.php
  2. +8
    -3
      common/models/Producer.php
  3. +17
    -0
      console/migrations/m190222_090304_ajout_champs_options_credit.php

+ 10
- 0
backend/views/producer/update.php 파일 보기

@@ -183,6 +183,16 @@ $this->addBreadcrumb($this->getTitle()) ;
Producer::CREDIT_FUNCTIONING_OPTIONAL => 'Optionnelle',
Producer::CREDIT_FUNCTIONING_MANDATORY => 'Obligatoire',
], []) ; ?>
<?= $form->field($model, 'credit_limit',[
'template' => '{label}<div class="input-group">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}',
])->hint('Limite de crédit que l\'utilisateur ne pourra pas dépasser. Laisser vide pour permettre un crédit négatif et infini.'); ?>
<?= $form->field($model, 'use_credit_checked_default')
->dropDownList([
0 => 'Non',
1 => 'Oui',
], []) ; ?>
</div>
</div>

+ 8
- 3
common/models/Producer.php 파일 보기

@@ -60,6 +60,9 @@ use yii\helpers\Html;
* @property string gcs
* @property boolean option_allow_user_gift
* @property string credit_functioning
* @property boolean use_credit_checked_default
* @property float credit_limit
*
*/
class Producer extends ActiveRecordCommon
{
@@ -99,9 +102,9 @@ class Producer extends ActiveRecordCommon
}
}],
[['description','mentions','gcs','order_infos','slug','secret_key_payplug'], 'string'],
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription', 'option_allow_user_gift'], 'boolean'],
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription', 'option_allow_user_gift','use_credit_checked_default'], 'boolean'],
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code','type','credit_functioning'], 'string', 'max' => 255],
[['free_price', 'credit_limit_reminder'], 'double'],
[['free_price', 'credit_limit_reminder','credit_limit'], 'double'],
['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'],
];
}
@@ -137,7 +140,9 @@ class Producer extends ActiveRecordCommon
'mentions' => 'Mentions légales',
'gcs' => 'Conditions générales de vente',
'option_allow_user_gift' => 'Autoriser les utilisateurs à effectuer un don à la plateforme lors de leur commande',
'credit_functioning' => 'Utilisation du Crédit par l\'utilisateur'
'credit_functioning' => 'Utilisation du Crédit par l\'utilisateur',
'credit_limit' => 'Crédit limite',
'use_credit_checked_default' => 'Cocher par défaut l\'option "Utiliser mon crédit" lors de la commande de l\'utilisateur'
];
}


+ 17
- 0
console/migrations/m190222_090304_ajout_champs_options_credit.php 파일 보기

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

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

class m190222_090304_ajout_champs_options_credit extends Migration {

public function up() {
$this->addColumn('producer', 'credit_limit', Schema::TYPE_FLOAT) ;
$this->addColumn('producer', 'use_credit_checked_default', Schema::TYPE_BOOLEAN.' DEFAULT 1') ;
}

public function down() {
$this->dropColumn('producer', 'credit_limit') ;
$this->dropColumn('producer', 'use_credit_checked_default') ;
}
}

Loading…
취소
저장