<?php

namespace app\admin\model;

use app\BaseModel;

class ExpressionLanguages extends BaseModel
{
    protected $autoWriteTimestamp = true;
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';


    // 表达式对应分类
    public function category()
    {
        return $this->belongsTo(ExpressionCategory::class, 'category_id');
    }

    public function getImgAttribute($value)
    {
        return ensureUrl($value);
    }

}