la_bot_back/kernel/app_modules/card/models/CardTransaction.php

56 lines
1.3 KiB
PHP
Raw Normal View History

2025-01-20 00:12:30 +03:00
<?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 => "В процессе",
];
}
}