la_bot_back/kernel/app_modules/card/models/CardTransaction.php
2025-01-26 14:42:47 +03:00

58 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace kernel\app_modules\card\models;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $from
* @property integer $to
* @property integer $from_balance
* @property integer $to_balance
* @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', 'from_balance', 'to', 'to_balance', '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 => "В процессе",
];
}
}