add Notes

This commit is contained in:
Leorne
2019-12-05 15:05:33 +03:00
parent 2279783ca8
commit f7177975a8
16 changed files with 521 additions and 2 deletions

View File

@ -22,6 +22,7 @@ class FieldsValueNew extends \yii\db\ActiveRecord
const TYPE_PROJECT = 1;
const TYPE_COMPANY = 2;
const TYPE_BALANCE = 3;
const TYPE_NOTE = 4;
/**
* {@inheritdoc}
*/

66
common/models/Note.php Normal file
View File

@ -0,0 +1,66 @@
<?php
namespace common\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
/**
* This is the model class for table "note".
*$fildsValue
* @property int $id
* @property string $name
* @property string $description
* @property string $created_at
* @property string $updated_at
*/
class Note extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'note';
}
public function behaviors()
{
return [
[
'class' => TimestampBehavior::class,
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => new Expression('NOW()'),
],
];
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['name'], 'required'],
[['description'], 'string'],
[['created_at', 'updated_at'], 'safe'],
[['name'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'name' => 'Название',
'description' => 'Описание',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
}

View File

@ -22,6 +22,7 @@ class UseField extends \yii\db\ActiveRecord
const USE_PROJECT = 1;
const USE_COMPANY = 2;
const USE_BALANCE = 3;
const USE_NOTE = 4;
/**
@ -70,7 +71,8 @@ class UseField extends \yii\db\ActiveRecord
self::USE_PROFILE => 'Профиль',
self::USE_PROJECT => 'Проект',
self::USE_COMPANY => 'Компания',
self::USE_BALANCE => 'Баланс'
self::USE_BALANCE => 'Баланс',
self::USE_NOTE => 'Заметка'
];
}

View File

@ -22,6 +22,7 @@ class UseStatus extends \yii\db\ActiveRecord
const USE_PROJECT = 1;
const USE_COMPANY = 2;
const USE_BALANCE = 3;
const USE_NOTE= 4;
/**
* {@inheritdoc}
@ -69,7 +70,8 @@ class UseStatus extends \yii\db\ActiveRecord
self::USE_PROFILE => 'Профиль',
self::USE_PROJECT => 'Проект',
self::USE_COMPANY => 'Компания',
self::USE_BALANCE => 'Баланс'
self::USE_BALANCE => 'Баланс',
self::USE_NOTE => 'Заметка'
];
}