hyperf-view/app/System/Model/SystemApiGroup.php

49 lines
1.5 KiB
PHP

<?php
declare (strict_types=1);
namespace App\System\Model;
use Hyperf\Database\Model\SoftDeletes;
use Builder\BaseModel;
/**
* @property int $id 主键
* @property string $name 接口组名称
* @property int $status 状态 (1正常 2停用)
* @property int $created_by 创建者
* @property int $updated_by 更新者
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 更新时间
* @property string $deleted_at 删除时间
* @property string $remark 备注
* @property-read \Hyperf\Database\Model\Collection|SystemApi[] $apis
*/
class SystemApiGroup extends BaseModel
{
use SoftDeletes;
/**
* The table associated with the model.
*
* @var string
*/
protected ?string $table = 'system_api_group';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected array $fillable = ['id', 'name', 'status', 'created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'remark'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected array $casts = ['id' => 'integer', 'status' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
/**
* 关联API
* @return \Hyperf\Database\Model\Relations\hasMany
*/
public function apis() : \Hyperf\Database\Model\Relations\hasMany
{
return $this->hasMany(SystemApi::class, 'group_id', 'id');
}
}