64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
||
|
||
namespace app\models\file;
|
||
|
||
use Yii;
|
||
|
||
/**
|
||
* This is the model class for table "{{%upload_file}}".
|
||
*
|
||
* @property int $id ID
|
||
* @property int $cx_mch_id 平台商户ID
|
||
* @property int $file_source 文件源,0=本地存储,1=阿里云
|
||
* @property int $user_id 用户ID
|
||
* @property string|null $file_url 文件地址
|
||
* @property string|null $extension 扩展名
|
||
* @property string|null $type 类型
|
||
* @property int $size 大小
|
||
* @property int $is_delete 是否删除
|
||
* @property int $created_at 添加时间
|
||
* @property int $group_id 文件组ID
|
||
*/
|
||
class UploadFile extends \yii\db\ActiveRecord
|
||
{
|
||
/**
|
||
* {@inheritdoc}
|
||
*/
|
||
public static function tableName()
|
||
{
|
||
return '{{%upload_file}}';
|
||
}
|
||
|
||
/**
|
||
* {@inheritdoc}
|
||
*/
|
||
public function rules()
|
||
{
|
||
return [
|
||
[['cx_mch_id', 'file_source', 'user_id', 'size', 'is_delete', 'created_at', 'group_id'], 'integer'],
|
||
[['file_url'], 'string', 'max' => 2048],
|
||
[['extension', 'type'], 'string', 'max' => 256],
|
||
];
|
||
}
|
||
|
||
/**
|
||
* {@inheritdoc}
|
||
*/
|
||
public function attributeLabels()
|
||
{
|
||
return [
|
||
'id' => 'ID',
|
||
'cx_mch_id' => '平台商户ID',
|
||
'file_source' => '文件源,0=本地存储,1=阿里云',
|
||
'user_id' => '用户ID',
|
||
'file_url' => '文件地址',
|
||
'extension' => '扩展名',
|
||
'type' => '类型',
|
||
'size' => '大小',
|
||
'is_delete' => '是否删除',
|
||
'created_at' => '添加时间',
|
||
'group_id' => '文件组ID',
|
||
];
|
||
}
|
||
}
|