refactor: 修改model
This commit is contained in:
43
app/common/model/ArticleBaseModel.php
Normal file
43
app/common/model/ArticleBaseModel.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class ArticleBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'article';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'language_id' => 'int',
|
||||
'category_id' => 'int',
|
||||
'title' => 'string',
|
||||
'author' => 'string',
|
||||
'source' => 'string',
|
||||
'image' => 'string',
|
||||
'desc' => 'string',
|
||||
'recommend' => 'int',
|
||||
'release_time' => 'int',
|
||||
'sort' => 'int',
|
||||
'link' => 'string',
|
||||
'content' => 'string',
|
||||
'view_count' => 'int',
|
||||
'praise_count' => 'int',
|
||||
'seo_title' => 'string',
|
||||
'seo_keywords' => 'string',
|
||||
'seo_desc' => 'string',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
38
app/common/model/ArticleCategoryBaseModel.php
Normal file
38
app/common/model/ArticleCategoryBaseModel.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class ArticleCategoryBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'article_category';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'language_id' => 'int',
|
||||
'pid' => 'int',
|
||||
'name' => 'string',
|
||||
'short_name' => 'string',
|
||||
'icon' => 'string',
|
||||
'desc' => 'string',
|
||||
'sort' => 'int',
|
||||
'level' => 'int',
|
||||
'is_show' => 'int',
|
||||
'seo_title' => 'string',
|
||||
'seo_keywords' => 'string',
|
||||
'seo_desc' => 'string',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
30
app/common/model/CountryBaseModel.php
Normal file
30
app/common/model/CountryBaseModel.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class CountryBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'sys_country';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'name' => 'string',
|
||||
'code' => 'string',
|
||||
'icon' => 'string',
|
||||
'status' => 'int',
|
||||
'sort' => 'int',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
33
app/common/model/LanguageBaseModel.php
Normal file
33
app/common/model/LanguageBaseModel.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class LanguageBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'sys_language';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'country_id' => 'int',
|
||||
'name' => 'string',
|
||||
'code' => 'string',
|
||||
'icon' => 'string',
|
||||
'url' => 'string',
|
||||
'status' => 'int',
|
||||
'is_default' => 'int',
|
||||
'sort' => 'int',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
34
app/common/model/UserBaseModel.php
Normal file
34
app/common/model/UserBaseModel.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class UserBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'sys_user';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'username' => 'string',
|
||||
'password' => 'string',
|
||||
'salt' => 'string',
|
||||
'role_id' => 'int',
|
||||
'nickname' => 'string',
|
||||
'avatar' => 'string',
|
||||
'mobile' => 'string',
|
||||
'email' => 'string',
|
||||
'status' => 'int',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
29
app/common/model/UserLoginLogBaseModel.php
Normal file
29
app/common/model/UserLoginLogBaseModel.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class UserLoginLogBaseModel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'sys_user_login_log';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 字段信息
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'user_id' => 'int',
|
||||
'ip' => 'string',
|
||||
'user_agent' => 'string',
|
||||
'message' => 'string',
|
||||
'status' => 'int',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user