Fix hide reception cart

- add property user_cart_on
- add property product_sale_default_focus
- add property ticket_create-price_editable
- add discount product/ticket enabled
This commit is contained in:
2016-02-28 15:48:30 +01:00
parent b476febb10
commit 2e3a8d53ca
18 changed files with 175 additions and 143 deletions

View File

@@ -14,6 +14,8 @@ use yii\helpers\ArrayHelper;
* @property integer $status
* @property integer $type
* @property integer $value
* @property integer $product_enabled
* @property integer $ticket_enabled
* @property string $created_at
* @property string $updated_at
*/
@@ -51,7 +53,7 @@ class Discount extends \yii\db\ActiveRecord
{
return [
[['name','value'], 'required'],
[['status', 'type', 'value'], 'integer'],
[['status', 'type', 'value','product_enabled','ticket_enabled'], 'integer'],
[['name'], 'string', 'max' => 64]
];
}
@@ -69,6 +71,8 @@ class Discount extends \yii\db\ActiveRecord
'value' => Yii::t('common/discount', 'Value'),
'created_at' => Yii::t('common/discount', 'Created At'),
'updated_at' => Yii::t('common/discount', 'Updated At'),
'product_enabled' => "Termékre adható",
'ticket_enabled' => "Bérletre adható",
];
}
@@ -104,10 +108,28 @@ class Discount extends \yii\db\ActiveRecord
return $result;
}
public function getProcutEnabledHuman(){
return $this->product_enabled == 1 ? 'Igen' : 'Nem';
}
public function getTicketEnabledHuman(){
return $this->ticket_enabled == 1 ? 'Igen' : 'Nem';
}
public static function read(){
return Discount::find()->andWhere([ 'status' => self::STATUS_ACTIVE ])->all();
}
public static function readProductDiscounts(){
return Discount::find()->andWhere([ 'status' => self::STATUS_ACTIVE , 'product_enabled' => 1 ])->all();
}
public static function readTicketDiscounts(){
return Discount::find()->andWhere([ 'status' => self::STATUS_ACTIVE , 'ticket_enabled' => 1 ])->all();
}
/**
* @param integer $money
* @param common\models\Discount $discount