transaction
This commit is contained in:
56
kernel/app_modules/card/models/CardTransaction.php
Normal file
56
kernel/app_modules/card/models/CardTransaction.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\app_modules\card\models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property integer $from
|
||||
* @property integer $to
|
||||
* @property integer $amount
|
||||
* @property integer $type
|
||||
* @property integer $status
|
||||
*/
|
||||
class CardTransaction extends Model
|
||||
{
|
||||
|
||||
const DISABLE_STATUS = 0;
|
||||
const SUCCESS_STATUS = 1;
|
||||
const IN_PROGRESS_STATUS = 2;
|
||||
|
||||
protected $table = 'card_transaction';
|
||||
|
||||
protected $fillable = ['from', 'to', 'amount', 'type', 'status'];
|
||||
|
||||
public static function labels(): array
|
||||
{
|
||||
// Заполнить массив
|
||||
// Пример: [
|
||||
// 'label' => 'Заголовок',
|
||||
// 'entity' => 'Сущность',
|
||||
// 'slug' => 'Slug',
|
||||
// 'status' => 'Статус',
|
||||
// ]
|
||||
|
||||
return [
|
||||
'from' => 'От',
|
||||
'to' => 'Кому',
|
||||
'amount' => 'Количество',
|
||||
'type' => 'Тип операции',
|
||||
'status' => 'Статус',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getStatus(): array
|
||||
{
|
||||
return [
|
||||
self::DISABLE_STATUS => "Не активный",
|
||||
self::SUCCESS_STATUS => "Завершен",
|
||||
self::IN_PROGRESS_STATUS => "В процессе",
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user