修复资源用mvc

This commit is contained in:
2025-05-19 11:24:10 +08:00
parent f4f4bc600b
commit a7b82e1e26
21 changed files with 1871 additions and 444 deletions
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace app\admin\model\Article;
use think\Model;
class Article extends Model
{
// 设置当前模型对应的数据表名称(不含前缀)
protected $name = 'article';
// 设置主键
protected $pk = 'id';
}
@@ -0,0 +1,13 @@
<?php
namespace app\admin\model\Article;
use think\Model;
class ArticleCategory extends Model
{
// 设置当前模型对应的数据表名称(不含前缀)
protected $name = 'article_category';
// 设置主键
protected $pk = 'id';
}
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace app\admin\model\Resource;
use think\Model;
class Resource extends Model
{
// 设置当前模型对应的数据表名称(不含前缀)
protected $name = 'resources';
// 设置主键
protected $pk = 'id';
}
@@ -0,0 +1,13 @@
<?php
namespace app\admin\model\Resource;
use think\Model;
class ResourceCategory extends Model
{
// 设置当前模型对应的数据表名称(不含前缀)
protected $name = 'resources_category';
// 设置主键
protected $pk = 'id';
}
+10 -2
View File
@@ -3,10 +3,17 @@
* 配置表
*/
namespace app\admin\model;
use app\admin\model\Base;
class YzAdminConfig extends Base{
use think\Model;
class YzAdminConfig extends Model
{
// 设置当前模型对应的数据表名称(不含前缀)
protected $name = 'admin_config';
// 设置主键
protected $pk = 'config_id';
/**
* 列出全部配置,key对应value
*/
@@ -22,6 +29,7 @@ class YzAdminConfig extends Base{
}
return $return;
}
/**
* 多条数据更新
*/