feat: 添加附件(下载管理)分类分页/详情/新增/更新/设置排序值/删除接口
This commit is contained in:
27
app/admin/model/v1/AttachmentCategoryModel.php
Normal file
27
app/admin/model/v1/AttachmentCategoryModel.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model\v1;
|
||||
|
||||
use app\common\model\AttachmentCategoryBaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 附件(下载管理)分类模型
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class AttachmentCategoryModel extends AttachmentCategoryBaseModel
|
||||
{
|
||||
// 启用软件删除
|
||||
use SoftDelete;
|
||||
// 软删除字段
|
||||
protected $deleteTime = 'deleted_at';
|
||||
// 自动写入时间格式
|
||||
protected $autoWriteTimestamp = 'datetime';
|
||||
|
||||
// 关联附件
|
||||
public function attachment()
|
||||
{
|
||||
return $this->hasMany(AttachmentModel::class, 'category_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user