ServerInformationLog.php 858 字节
<?php

namespace App\Models\Devops;

use Illuminate\Database\Eloquent\Model;

class ServerInformationLog extends Model
{
    protected $table = 'gl_server_information_log';

    public function getOriginalAttribute($value)
    {
        return json_decode($value, true);
    }

    public function getRevisedAttribute($value)
    {
        return json_decode($value, true);
    }

    /** @var int 日志添加 */
    const ACTION_ADD = 1;
    /** @var int 日志修改 */
    const ACTION_UPDATE = 2;
    /** @var int 日志删除 */
    const ACTION_DELETE = 3;
    /** @var int 日志恢复 */
    const ACTION_RECOVER = 4;


    /**
     * @return string[]
     */
    public static function actionArr()
    {
        return [
            1 => '添加',
            2 => '修改',
            3 => '删除',
            4 => '恢复',
        ];
    }
}