mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
59
models/Notification.php
Normal file
59
models/Notification.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "notifications".
|
||||
*
|
||||
* @property integer $id
|
||||
* @property mixed tm_send
|
||||
* @property mixed tm_create
|
||||
* @property mixed payload
|
||||
* @property mixed message
|
||||
*/
|
||||
class Notification extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'notifications';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['message', 'payload', 'tm_create', 'tm_send'], 'safe']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'message' => 'Сообщение',
|
||||
'payload' => 'payload',
|
||||
'tm_create' => 'Дата создания',
|
||||
'tm_send' => 'Дата отправки'
|
||||
];
|
||||
}
|
||||
|
||||
public function getResults()
|
||||
{
|
||||
return $this->hasMany(NotificationResult::className(), ["notify_id" => "id"]);
|
||||
}
|
||||
|
||||
public function getGoodResults()
|
||||
{
|
||||
return $this->hasMany(NotificationResult::className(), ["notify_id" => "id"])->where(["status" => 200]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue