implement registration in backend
This commit is contained in:
@@ -24,13 +24,22 @@ use yii\helpers\ArrayHelper;
|
||||
* @property integer door_allowed
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
* @property integer $max_reservation_count
|
||||
* @property \common\models\Account $account
|
||||
* @property string $typeHuman
|
||||
* @property string $timeUnitHuman
|
||||
* @property string $accountName
|
||||
*/
|
||||
class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
class TicketType extends BaseFitnessActiveRecord
|
||||
{
|
||||
const STATUS_DELETED = 0;
|
||||
const STATUS_ACTIVE = 10;
|
||||
CONST TIME_UNIT_DAY = 10;//nap
|
||||
CONST TIME_UNIT_MONTH = 20;//hónap
|
||||
CONST TIME_UNIT_MONTH_REFERENCE = 30; //tárgy hónap
|
||||
// day
|
||||
CONST TIME_UNIT_DAY = 10;
|
||||
// month
|
||||
CONST TIME_UNIT_MONTH = 20;
|
||||
// subject month
|
||||
CONST TIME_UNIT_MONTH_REFERENCE = 30;
|
||||
const TYPE_NORMAL = 10;
|
||||
const TYPE_DEFAULT = self::TYPE_NORMAL;
|
||||
|
||||
@@ -57,7 +66,7 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name', 'id_account','time_unit_count','type' ,'time_unit_type' ,'max_usage_count','price_brutto'], 'required'],
|
||||
[['name', 'id_account','time_unit_count','type' ,'time_unit_type' ,'max_usage_count','max_reservation_count','price_brutto'], 'required'],
|
||||
////////////////
|
||||
//price brutto
|
||||
////////////////
|
||||
@@ -76,6 +85,10 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
////////////////
|
||||
[['max_usage_count',], 'integer','min' => 0 , 'max' => 10000],
|
||||
////////////////
|
||||
//max_reservation_count
|
||||
////////////////
|
||||
[['max_reservation_count',], 'integer','min' => 0 , 'max' => 10000],
|
||||
////////////////
|
||||
//flag_student
|
||||
////////////////
|
||||
[['flag_student',], 'integer'],
|
||||
@@ -140,6 +153,7 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
'installment_count' => Yii::t('common/ticket_type', 'Havi részletek száma'),
|
||||
'installment_money' => Yii::t('common/ticket_type', 'Havi részlet összege'),
|
||||
'door_allowed' => Yii::t('common/ticket_type', 'Forgóvilla'),
|
||||
'max_reservation_count' => Yii::t('common/ticket_type', 'Max Reservation Count'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -169,7 +183,7 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
}
|
||||
public function getTimeUnitHuman() {
|
||||
$result = null;
|
||||
$s = self::timeUnitTypes ( $this->time_unit_type );
|
||||
$s = self::timeUnitTypes( );
|
||||
if (array_key_exists ( $this->time_unit_type, $s )) {
|
||||
$result = $s [$this->time_unit_type];
|
||||
}
|
||||
@@ -210,7 +224,7 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
}
|
||||
|
||||
|
||||
public function validateIdAccount($attribute,$params){
|
||||
public function validateIdAccount($attribute){
|
||||
$account = null;
|
||||
if ( !$this->hasErrors("id_account")){
|
||||
$account = Account::findOne($this->$attribute);
|
||||
@@ -233,9 +247,12 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||
* */
|
||||
/**
|
||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||
* @param null $forceIncludeObjectWithId
|
||||
* @param null $account
|
||||
* @return array|\yii\db\ActiveRecord[]|null
|
||||
*/
|
||||
public static function read($forceIncludeObjectWithId = null, $account = null){
|
||||
$ticketTypes = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user