add kulcsok, add tartós beszedés, add ticket type with intallments
This commit is contained in:
86
common/models/Ugiro.php
Normal file
86
common/models/Ugiro.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/**
|
||||
* This is the model class for table "ugiro".
|
||||
*
|
||||
* @property integer $id_ugiro
|
||||
* @property integer $id_user
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
class Ugiro extends \yii\db\ActiveRecord
|
||||
{
|
||||
|
||||
public static $PATH_MEGBIZAS = "giro/megbizas";
|
||||
public static $STATUS_SENT = 0;
|
||||
public static $STATUS_FINISHED = 1;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'ugiro';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => TimestampBehavior::className(),
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
||||
],
|
||||
], parent::behaviors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_ugiro' => Yii::t('common/ticket_installment_request', 'Id Ugiro'),
|
||||
'id_user' => Yii::t('common/ticket_installment_request', 'Id User'),
|
||||
'created_at' => Yii::t('common/ticket_installment_request', 'Created At'),
|
||||
'updated_at' => Yii::t('common/ticket_installment_request', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
public function getUser(){
|
||||
return $this->hasOne( User::className(), ["id" =>"id_user" ] );
|
||||
}
|
||||
|
||||
public static function statuses() {
|
||||
return [
|
||||
static::$STATUS_SENT =>"Folyamatban",
|
||||
static::$STATUS_FINISHED =>"Befejezve",
|
||||
]
|
||||
;
|
||||
}
|
||||
|
||||
public function getStatusName( ) {
|
||||
$statuses = static::statuses() ;
|
||||
$result = "Ismeretlen";
|
||||
if ( array_key_exists($this->status, $statuses)){
|
||||
$result = $statuses[$this->status];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user