新增附件管理
This commit is contained in:
parent
5181915e3c
commit
a8c98a0a05
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Attachments extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('attachments',['engine'=>'Myisam', 'comment' => '附件管理', 'signed' => false]);
|
||||
$table->addColumn('path', 'string',['limit' => 50,'default'=>'','comment'=>'附件存储路径'])
|
||||
->addColumn('mime_type', 'string',['default'=> '', 'limit' => 100, 'comment'=>'资源mimeType'])
|
||||
->addColumn('file_ext', 'string',['default'=> '','limit' => 100, 'comment'=>'资源后缀'])
|
||||
->addColumn('file_size', 'integer',['default'=> 0, 'comment'=>'资源大小'])
|
||||
->addColumn('filename', 'string',['default'=>'', 'limit' => 255, 'comment'=>'资源名称'])
|
||||
->addColumn('driver', 'string',['default'=> 0, 'limit' => 20, 'comment' => 'local,oss,qcloud,qiniu'])
|
||||
->addColumn('created_at', 'integer', array('default'=>0, 'comment'=>'创建时间', 'signed' => false ))
|
||||
->addColumn('updated_at', 'integer', array('default'=>0, 'comment'=>'更新时间', 'signed' => false ))
|
||||
->addColumn('deleted_at', 'integer', array('default'=>0, 'comment'=>'删除时间', 'signed' => false ))
|
||||
->create();
|
||||
}
|
||||
}
|
22
catch/system/model/Attachments.php
Normal file
22
catch/system/model/Attachments.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\model;
|
||||
|
||||
use catcher\base\CatchModel;
|
||||
|
||||
class Attachments extends CatchModel
|
||||
{
|
||||
protected $name = 'attachments';
|
||||
|
||||
protected $field = [
|
||||
'id', //
|
||||
'path', // 附件存储路径
|
||||
'mime_type', // 资源mimeType
|
||||
'file_ext', // 资源后缀
|
||||
'file_size', // 资源大小
|
||||
'filename', // 资源名称
|
||||
'driver', // local,oss,qcloud,qiniu
|
||||
'created_at', // 创建时间
|
||||
'updated_at', // 更新时间
|
||||
'deleted_at', // 删除时间
|
||||
];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user