初始化仓库
This commit is contained in:
50
app/common/model/BaseModel.php
Normal file
50
app/common/model/BaseModel.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use app\common\service\FileService;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 基础模型
|
||||
* Class BaseModel
|
||||
* @package app\common\model
|
||||
*/
|
||||
class BaseModel extends Model
|
||||
{
|
||||
/**
|
||||
* @notes 公共处理图片,补全路径
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author 张无忌
|
||||
* @date 2021/9/10 11:02
|
||||
*/
|
||||
public function getImageAttr($value)
|
||||
{
|
||||
return trim($value) ? FileService::getFileUrl($value) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 公共图片处理,去除图片域名
|
||||
* @param $value
|
||||
* @return mixed|string
|
||||
* @author 张无忌
|
||||
* @date 2021/9/10 11:04
|
||||
*/
|
||||
public function setImageAttr($value)
|
||||
{
|
||||
return trim($value) ? FileService::setFileUrl($value) : '';
|
||||
}
|
||||
}
|
||||
19
app/common/model/Config.php
Normal file
19
app/common/model/Config.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
class Config extends BaseModel
|
||||
{
|
||||
}
|
||||
80
app/common/model/Crontab.php
Normal file
80
app/common/model/Crontab.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use app\common\enum\CrontabEnum;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 定时任务模型
|
||||
* Class Crontab
|
||||
* @package app\common\model
|
||||
*/
|
||||
class Crontab extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
protected $name = 'dev_crontab';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 类型获取器
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 12:05
|
||||
*/
|
||||
public function getTypeDescAttr($value)
|
||||
{
|
||||
$desc = [
|
||||
CrontabEnum::CRONTAB => '定时任务',
|
||||
CrontabEnum::DAEMON => '守护进程',
|
||||
];
|
||||
return $desc[$value] ?? '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 状态获取器
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 12:06
|
||||
*/
|
||||
public function getStatusDescAttr($value)
|
||||
{
|
||||
$desc = [
|
||||
CrontabEnum::START => '运行',
|
||||
CrontabEnum::STOP => '停止',
|
||||
CrontabEnum::ERROR => '错误',
|
||||
];
|
||||
return $desc[$value] ?? '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 最后执行时间获取器
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/3/29 12:06
|
||||
*/
|
||||
public function getLastTimeAttr($value)
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
}
|
||||
20
app/common/model/HotSearch.php
Normal file
20
app/common/model/HotSearch.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
class HotSearch extends BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
9
app/common/model/OperationLog.php
Normal file
9
app/common/model/OperationLog.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
|
||||
class OperationLog extends BaseModel
|
||||
{
|
||||
}
|
||||
112
app/common/model/article/Article.php
Normal file
112
app/common/model/article/Article.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\article;
|
||||
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 资讯管理模型
|
||||
* Class Article
|
||||
* @package app\common\model\article;
|
||||
*/
|
||||
class Article extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
/**
|
||||
* @notes 获取分类名称
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author heshihu
|
||||
* @date 2022/2/22 9:53
|
||||
*/
|
||||
public function getCateNameAttr($value, $data)
|
||||
{
|
||||
return ArticleCate::where('id', $data['cid'])->value('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 浏览量
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/9/15 11:33
|
||||
*/
|
||||
public function getClickAttr($value, $data)
|
||||
{
|
||||
return $data['click_actual'] + $data['click_virtual'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置图片域名
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array|string|string[]|null
|
||||
* @author 段誉
|
||||
* @date 2022/9/28 10:17
|
||||
*/
|
||||
public function getContentAttr($value, $data)
|
||||
{
|
||||
return get_file_domain($value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 清除图片域名
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array|string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/9/28 10:17
|
||||
*/
|
||||
public function setContentAttr($value, $data)
|
||||
{
|
||||
return clear_file_domain($value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取文章详情
|
||||
* @param $id
|
||||
* @return array
|
||||
* @author 段誉
|
||||
* @date 2022/10/20 15:23
|
||||
*/
|
||||
public static function getArticleDetailArr(int $id)
|
||||
{
|
||||
$article = Article::where(['id' => $id, 'is_show' => YesNoEnum::YES])
|
||||
->findOrEmpty();
|
||||
|
||||
if ($article->isEmpty()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 增加点击量
|
||||
$article->click_actual += 1;
|
||||
$article->save();
|
||||
|
||||
return $article->append(['click'])
|
||||
->hidden(['click_virtual', 'click_actual'])
|
||||
->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
74
app/common/model/article/ArticleCate.php
Normal file
74
app/common/model/article/ArticleCate.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\article;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 资讯分类管理模型
|
||||
* Class ArticleCate
|
||||
* @package app\common\model\article;
|
||||
*/
|
||||
class ArticleCate extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 关联文章
|
||||
* @return \think\model\relation\HasMany
|
||||
* @author 段誉
|
||||
* @date 2022/10/19 16:59
|
||||
*/
|
||||
public function article()
|
||||
{
|
||||
return $this->hasMany(Article::class, 'cid', 'id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/9/15 11:25
|
||||
*/
|
||||
public function getIsShowDescAttr($value, $data)
|
||||
{
|
||||
return $data['is_show'] ? '启用' : '停用';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 文章数量
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return int
|
||||
* @author 段誉
|
||||
* @date 2022/9/15 11:32
|
||||
*/
|
||||
public function getArticleCountAttr($value, $data)
|
||||
{
|
||||
return Article::where(['cid' => $data['id']])->count('id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
52
app/common/model/article/ArticleCollect.php
Normal file
52
app/common/model/article/ArticleCollect.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\article;
|
||||
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 资讯收藏
|
||||
* Class ArticleCollect
|
||||
* @package app\common\model\article
|
||||
*/
|
||||
class ArticleCollect extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 是否已收藏文章
|
||||
* @param $userId
|
||||
* @param $articleId
|
||||
* @return bool (true=已收藏, false=未收藏)
|
||||
* @author 段誉
|
||||
* @date 2022/10/20 15:13
|
||||
*/
|
||||
public static function isCollectArticle($userId, $articleId)
|
||||
{
|
||||
$collect = ArticleCollect::where([
|
||||
'user_id' => $userId,
|
||||
'article_id' => $articleId,
|
||||
'status' => YesNoEnum::YES
|
||||
])->findOrEmpty();
|
||||
|
||||
return !$collect->isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
116
app/common/model/auth/Admin.php
Normal file
116
app/common/model/auth/Admin.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\dept\Dept;
|
||||
use think\model\concern\SoftDelete;
|
||||
use app\common\service\FileService;
|
||||
|
||||
class Admin extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
protected $append = [
|
||||
'role_id',
|
||||
'dept_id',
|
||||
'jobs_id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 关联角色id
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 15:00
|
||||
*/
|
||||
public function getRoleIdAttr($value, $data)
|
||||
{
|
||||
return AdminRole::where('admin_id', $data['id'])->column('role_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 关联部门id
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 15:00
|
||||
*/
|
||||
public function getDeptIdAttr($value, $data)
|
||||
{
|
||||
return AdminDept::where('admin_id', $data['id'])->column('dept_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 关联岗位id
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 15:01\
|
||||
*/
|
||||
public function getJobsIdAttr($value, $data)
|
||||
{
|
||||
return AdminJobs::where('admin_id', $data['id'])->column('jobs_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取禁用状态
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/7 01:25
|
||||
*/
|
||||
public function getDisableDescAttr($value, $data)
|
||||
{
|
||||
return YesNoEnum::getDisableDesc($data['disable']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 最后登录时间获取器 - 格式化:年-月-日 时:分:秒
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author Tab
|
||||
* @date 2021/7/13 11:35
|
||||
*/
|
||||
public function getLoginTimeAttr($value)
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 头像获取器 - 头像路径添加域名
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author Tab
|
||||
* @date 2021/7/13 11:35
|
||||
*/
|
||||
public function getAvatarAttr($value)
|
||||
{
|
||||
return empty($value) ? FileService::getFileUrl(config('project.default_image.admin_avatar')) : FileService::getFileUrl(trim($value, '/'));
|
||||
}
|
||||
|
||||
}
|
||||
32
app/common/model/auth/AdminDept.php
Normal file
32
app/common/model/auth/AdminDept.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class AdminDept extends BaseModel
|
||||
{
|
||||
/**
|
||||
* @notes 删除用户关联部门
|
||||
* @param $adminId
|
||||
* @return bool
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 14:14
|
||||
*/
|
||||
public static function delByUserId($adminId)
|
||||
{
|
||||
return self::where(['admin_id' => $adminId])->delete();
|
||||
}
|
||||
}
|
||||
32
app/common/model/auth/AdminJobs.php
Normal file
32
app/common/model/auth/AdminJobs.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class AdminJobs extends BaseModel
|
||||
{
|
||||
/**
|
||||
* @notes 删除用户关联岗位
|
||||
* @param $adminId
|
||||
* @return bool
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 14:14
|
||||
*/
|
||||
public static function delByUserId($adminId)
|
||||
{
|
||||
return self::where(['admin_id' => $adminId])->delete();
|
||||
}
|
||||
}
|
||||
34
app/common/model/auth/AdminRole.php
Normal file
34
app/common/model/auth/AdminRole.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class AdminRole extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 删除用户关联角色
|
||||
* @param $adminId
|
||||
* @return bool
|
||||
* @author 段誉
|
||||
* @date 2022/11/25 14:14
|
||||
*/
|
||||
public static function delByUserId($adminId)
|
||||
{
|
||||
return self::where(['admin_id' => $adminId])->delete();
|
||||
}
|
||||
|
||||
}
|
||||
32
app/common/model/auth/AdminSession.php
Normal file
32
app/common/model/auth/AdminSession.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class AdminSession extends BaseModel
|
||||
{
|
||||
/**
|
||||
* @notes 关联管理员表
|
||||
* @return \think\model\relation\HasOne
|
||||
* @author 令狐冲
|
||||
* @date 2021/7/5 14:39
|
||||
*/
|
||||
public function admin()
|
||||
{
|
||||
return $this->hasOne(Admin::class, 'id', 'admin_id')
|
||||
->field('id,multipoint_login');
|
||||
}
|
||||
}
|
||||
31
app/common/model/auth/SystemMenu.php
Normal file
31
app/common/model/auth/SystemMenu.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 系统菜单
|
||||
* Class SystemMenu
|
||||
* @package app\common\model\auth
|
||||
*/
|
||||
class SystemMenu extends BaseModel
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
43
app/common/model/auth/SystemRole.php
Normal file
43
app/common/model/auth/SystemRole.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 角色模型
|
||||
* Class Role
|
||||
* @package app\common\model
|
||||
*/
|
||||
class SystemRole extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
protected $name = 'system_role';
|
||||
|
||||
/**
|
||||
* @notes 角色与菜单关联关系
|
||||
* @return \think\model\relation\HasMany
|
||||
* @author 段誉
|
||||
* @date 2022/7/6 11:16
|
||||
*/
|
||||
public function roleMenuIndex()
|
||||
{
|
||||
return $this->hasMany(SystemRoleMenu::class, 'role_id');
|
||||
}
|
||||
}
|
||||
30
app/common/model/auth/SystemRoleMenu.php
Normal file
30
app/common/model/auth/SystemRoleMenu.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\common\model\auth;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 角色与菜单权限关系
|
||||
* Class SystemRoleMenu
|
||||
* @package app\common\model\auth
|
||||
*/
|
||||
class SystemRoleMenu extends BaseModel
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
28
app/common/model/channel/OfficialAccountReply.php
Normal file
28
app/common/model/channel/OfficialAccountReply.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\channel;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 微信公众号回复
|
||||
* Class OfficialAccountReply
|
||||
* @package app\common\model\channel
|
||||
*/
|
||||
class OfficialAccountReply extends BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
28
app/common/model/decorate/DecoratePage.php
Normal file
28
app/common/model/decorate/DecoratePage.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\common\model\decorate;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 装修配置-页面
|
||||
* Class DecorateTabbar
|
||||
* @package app\common\model\decorate
|
||||
*/
|
||||
class DecoratePage extends BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
63
app/common/model/decorate/DecorateTabbar.php
Normal file
63
app/common/model/decorate/DecorateTabbar.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\common\model\decorate;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\service\FileService;
|
||||
|
||||
|
||||
/**
|
||||
* 装修配置-底部导航
|
||||
* Class DecorateTabbar
|
||||
* @package app\common\model\decorate
|
||||
*/
|
||||
class DecorateTabbar extends BaseModel
|
||||
{
|
||||
// 设置json类型字段
|
||||
protected $json = ['link'];
|
||||
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取底部导航列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/9/23 12:07
|
||||
*/
|
||||
public static function getTabbarLists()
|
||||
{
|
||||
$tabbar = self::select()->toArray();
|
||||
|
||||
if (empty($tabbar)) {
|
||||
return $tabbar;
|
||||
}
|
||||
|
||||
foreach ($tabbar as &$item) {
|
||||
if (!empty($item['selected'])) {
|
||||
$item['selected'] = FileService::getFileUrl($item['selected']);
|
||||
}
|
||||
if (!empty($item['unselected'])) {
|
||||
$item['unselected'] = FileService::getFileUrl($item['unselected']);
|
||||
}
|
||||
}
|
||||
|
||||
return $tabbar;
|
||||
}
|
||||
}
|
||||
46
app/common/model/dept/Dept.php
Normal file
46
app/common/model/dept/Dept.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\dept;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 部门模型
|
||||
* Class Dept
|
||||
* @package app\common\model\article
|
||||
*/
|
||||
class Dept extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
/**
|
||||
* @notes 状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:03
|
||||
*/
|
||||
public function getStatusDescAttr($value, $data)
|
||||
{
|
||||
return $data['status'] ? '正常' : '停用';
|
||||
}
|
||||
|
||||
}
|
||||
44
app/common/model/dept/Jobs.php
Normal file
44
app/common/model/dept/Jobs.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\dept;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 岗位模型
|
||||
* Class Jobs
|
||||
* @package app\common\model\dept
|
||||
*/
|
||||
class Jobs extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
/**
|
||||
* @notes 状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/5/25 18:03
|
||||
*/
|
||||
public function getStatusDescAttr($value, $data)
|
||||
{
|
||||
return $data['status'] ? '正常' : '停用';
|
||||
}
|
||||
}
|
||||
47
app/common/model/dict/DictData.php
Normal file
47
app/common/model/dict/DictData.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\dict;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 字典数据模型
|
||||
* Class DictData
|
||||
* @package app\common\model\dict
|
||||
*/
|
||||
class DictData extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 16:31
|
||||
*/
|
||||
public function getStatusDescAttr($value, $data)
|
||||
{
|
||||
return $data['status'] ? '正常' : '停用';
|
||||
}
|
||||
|
||||
}
|
||||
47
app/common/model/dict/DictType.php
Normal file
47
app/common/model/dict/DictType.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\dict;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 字典类型模型
|
||||
* Class DictType
|
||||
* @package app\common\model\dict
|
||||
*/
|
||||
class DictType extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/6/20 15:54
|
||||
*/
|
||||
public function getStatusDescAttr($value, $data)
|
||||
{
|
||||
return $data['status'] ? '正常' : '停用';
|
||||
}
|
||||
|
||||
}
|
||||
24
app/common/model/file/File.php
Normal file
24
app/common/model/file/File.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\file;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class File extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
25
app/common/model/file/FileCate.php
Normal file
25
app/common/model/file/FileCate.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\file;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class FileCate extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
47
app/common/model/notice/NoticeRecord.php
Normal file
47
app/common/model/notice/NoticeRecord.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | // +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\notice;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 通知记录模型
|
||||
* Class Notice
|
||||
* @package app\common\model
|
||||
*/
|
||||
class NoticeRecord extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
}
|
||||
120
app/common/model/notice/NoticeSetting.php
Normal file
120
app/common/model/notice/NoticeSetting.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\notice;
|
||||
|
||||
|
||||
use app\common\enum\DefaultEnum;
|
||||
use app\common\enum\notice\NoticeEnum;
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class NoticeSetting extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 短信通知状态
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author ljj
|
||||
* @date 2022/2/16 3:22 下午
|
||||
*/
|
||||
public function getSmsStatusDescAttr($value,$data)
|
||||
{
|
||||
if ($data['sms_notice']) {
|
||||
$sms_text = json_decode($data['sms_notice'],true);
|
||||
return DefaultEnum::getEnableDesc($sms_text['status']);
|
||||
}else {
|
||||
return '停用';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 通知类型
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author ljj
|
||||
* @date 2022/2/17 2:50 下午
|
||||
*/
|
||||
public function getTypeDescAttr($value,$data)
|
||||
{
|
||||
return NoticeEnum::getTypeDesc($data['type']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 接收者描述获取器
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author Tab
|
||||
* @date 2021/8/18 16:42
|
||||
*/
|
||||
public function getRecipientDescAttr($value)
|
||||
{
|
||||
$desc = [
|
||||
1 => '买家',
|
||||
2 => '卖家',
|
||||
];
|
||||
return $desc[$value] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 系统通知获取器
|
||||
* @param $value
|
||||
* @return array|mixed
|
||||
* @author Tab
|
||||
* @date 2021/8/18 19:11
|
||||
*/
|
||||
public function getSystemNoticeAttr($value)
|
||||
{
|
||||
return empty($value) ? [] : json_decode($value, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 短信通知获取器
|
||||
* @param $value
|
||||
* @return array|mixed
|
||||
* @author Tab
|
||||
* @date 2021/8/18 19:12
|
||||
*/
|
||||
public function getSmsNoticeAttr($value)
|
||||
{
|
||||
return empty($value) ? [] : json_decode($value, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 公众号通知获取器
|
||||
* @param $value
|
||||
* @return array|mixed
|
||||
* @author Tab
|
||||
* @date 2021/8/18 19:13
|
||||
*/
|
||||
public function getOaNoticeAttr($value)
|
||||
{
|
||||
return empty($value) ? [] : json_decode($value, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 小程序通知获取器
|
||||
* @param $value
|
||||
* @return array|mixed
|
||||
* @author Tab
|
||||
* @date 2021/8/18 19:13
|
||||
*/
|
||||
public function getMnpNoticeAttr($value)
|
||||
{
|
||||
return empty($value) ? [] : json_decode($value, true);
|
||||
}
|
||||
}
|
||||
30
app/common/model/notice/SmsLog.php
Normal file
30
app/common/model/notice/SmsLog.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\notice;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 短信记录模型
|
||||
* Class SmsLog
|
||||
* @package app\common\model
|
||||
*/
|
||||
class SmsLog extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
56
app/common/model/pay/PayConfig.php
Normal file
56
app/common/model/pay/PayConfig.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\pay;
|
||||
|
||||
use app\common\enum\PayEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\service\FileService;
|
||||
|
||||
|
||||
class PayConfig extends BaseModel
|
||||
{
|
||||
protected $name = 'dev_pay_config';
|
||||
|
||||
// 设置json类型字段
|
||||
protected $json = ['config'];
|
||||
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* @notes 支付图标获取器 - 路径添加域名
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author ljj
|
||||
* @date 2021/7/28 2:12 下午
|
||||
*/
|
||||
public function getIconAttr($value)
|
||||
{
|
||||
return empty($value) ? '' : FileService::getFileUrl($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 支付方式名称获取器
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author ljj
|
||||
* @date 2021/7/31 2:24 下午
|
||||
*/
|
||||
public function getPayWayNameAttr($value,$data)
|
||||
{
|
||||
return PayEnum::getPayDesc($data['pay_way']);
|
||||
}
|
||||
}
|
||||
54
app/common/model/pay/PayWay.php
Normal file
54
app/common/model/pay/PayWay.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\pay;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\service\FileService;
|
||||
|
||||
|
||||
class PayWay extends BaseModel
|
||||
{
|
||||
protected $name = 'dev_pay_way';
|
||||
|
||||
public function getIconAttr($value,$data)
|
||||
{
|
||||
return FileService::getFileUrl($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 支付方式名称获取器
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/7/28 4:02 下午
|
||||
*/
|
||||
public static function getPayWayNameAttr($value,$data)
|
||||
{
|
||||
return PayConfig::where('id',$data['pay_config_id'])->value('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 关联支配配置模型
|
||||
* @return \think\model\relation\HasOne
|
||||
* @author ljj
|
||||
* @date 2021/10/11 3:04 下午
|
||||
*/
|
||||
public function payConfig()
|
||||
{
|
||||
return $this->hasOne(PayConfig::class,'id','pay_config_id');
|
||||
}
|
||||
}
|
||||
57
app/common/model/recharge/RechargeOrder.php
Normal file
57
app/common/model/recharge/RechargeOrder.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\recharge;
|
||||
|
||||
use app\common\enum\PayEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 充值订单模型
|
||||
* Class RechargeOrder
|
||||
* @package app\common\model
|
||||
*/
|
||||
class RechargeOrder extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 支付方式
|
||||
* @param $value
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 18:32
|
||||
*/
|
||||
public function getPayWayTextAttr($value, $data)
|
||||
{
|
||||
return PayEnum::getPayDesc($data['pay_way']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 支付状态
|
||||
* @param $value
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2023/2/23 18:32
|
||||
*/
|
||||
public function getPayStatusTextAttr($value, $data)
|
||||
{
|
||||
return PayEnum::getPayStatusDesc($data['pay_status']);
|
||||
}
|
||||
}
|
||||
58
app/common/model/refund/RefundLog.php
Normal file
58
app/common/model/refund/RefundLog.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\refund;
|
||||
|
||||
|
||||
use app\common\enum\RefundEnum;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 退款日志模型
|
||||
* Class RefundLog
|
||||
* @package app\common\model\refund
|
||||
*/
|
||||
class RefundLog extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 操作人描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/12/1 10:55
|
||||
*/
|
||||
public function getHandlerAttr($value, $data)
|
||||
{
|
||||
return Admin::where('id', $data['handle_id'])->value('name');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/12/1 10:55
|
||||
*/
|
||||
public function getRefundStatusTextAttr($value, $data)
|
||||
{
|
||||
return RefundEnum::getStatusDesc($data['refund_status']);
|
||||
}
|
||||
|
||||
}
|
||||
71
app/common/model/refund/RefundRecord.php
Normal file
71
app/common/model/refund/RefundRecord.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\refund;
|
||||
|
||||
|
||||
use app\common\enum\RefundEnum;
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 退款记录模型
|
||||
* Class RefundRecord
|
||||
* @package app\common\model\refund
|
||||
*/
|
||||
class RefundRecord extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 退款类型描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/12/1 10:41
|
||||
*/
|
||||
public function getRefundTypeTextAttr($value, $data)
|
||||
{
|
||||
return RefundEnum::getTypeDesc($data['refund_type']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款状态描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/12/1 10:44
|
||||
*/
|
||||
public function getRefundStatusTextAttr($value, $data)
|
||||
{
|
||||
return RefundEnum::getStatusDesc($data['refund_status']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 退款方式描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/12/6 11:08
|
||||
*/
|
||||
public function getRefundWayTextAttr($value, $data)
|
||||
{
|
||||
return RefundEnum::getWayDesc($data['refund_way']);
|
||||
}
|
||||
|
||||
}
|
||||
39
app/common/model/tools/GenerateColumn.php
Normal file
39
app/common/model/tools/GenerateColumn.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\tools;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 代码生成器-数据表字段信息模型
|
||||
* Class GenerateColumn
|
||||
* @package app\common\model\tools
|
||||
*/
|
||||
class GenerateColumn extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 关联table表
|
||||
* @return \think\model\relation\BelongsTo
|
||||
* @author 段誉
|
||||
* @date 2022/6/15 18:59
|
||||
*/
|
||||
public function generateTable()
|
||||
{
|
||||
return $this->belongsTo(GenerateTable::class, 'id', 'table_id');
|
||||
}
|
||||
}
|
||||
59
app/common/model/tools/GenerateTable.php
Normal file
59
app/common/model/tools/GenerateTable.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\tools;
|
||||
|
||||
use app\common\enum\GeneratorEnum;
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
/**
|
||||
* 代码生成器-数据表信息模型
|
||||
* Class GenerateTable
|
||||
* @package app\common\model\tools
|
||||
*/
|
||||
class GenerateTable extends BaseModel
|
||||
{
|
||||
|
||||
protected $json = ['menu', 'tree', 'relations', 'delete'];
|
||||
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* @notes 关联数据表字段
|
||||
* @return \think\model\relation\HasMany
|
||||
* @author 段誉
|
||||
* @date 2022/6/15 10:46
|
||||
*/
|
||||
public function tableColumn()
|
||||
{
|
||||
return $this->hasMany(GenerateColumn::class, 'table_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 模板类型描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/6/14 11:25
|
||||
*/
|
||||
public function getTemplateTypeDescAttr($value, $data)
|
||||
{
|
||||
return GeneratorEnum::getTemplateTypeDesc($data['template_type']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
176
app/common/model/user/User.php
Normal file
176
app/common/model/user/User.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\common\model\user;
|
||||
|
||||
|
||||
use app\common\enum\user\UserEnum;
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\service\FileService;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 用户模型
|
||||
* Class User
|
||||
* @package app\common\model\user
|
||||
*/
|
||||
class User extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
/**
|
||||
* @notes 关联用户授权模型
|
||||
* @return \think\model\relation\HasOne
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:03
|
||||
*/
|
||||
public function userAuth()
|
||||
{
|
||||
return $this->hasOne(UserAuth::class, 'user_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 搜索器-用户信息
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:12
|
||||
*/
|
||||
public function searchKeywordAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('sn|nickname|mobile|account', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 搜索器-注册来源
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:13
|
||||
*/
|
||||
public function searchChannelAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('channel', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 搜索器-注册时间
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:13
|
||||
*/
|
||||
public function searchCreateTimeStartAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('create_time', '>=', strtotime($value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 搜索器-注册时间
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @author 段誉
|
||||
* @date 2022/9/22 16:13
|
||||
*/
|
||||
public function searchCreateTimeEndAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('create_time', '<=', strtotime($value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 头像获取器 - 用于头像地址拼接域名
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author Tab
|
||||
* @date 2021/7/17 14:28
|
||||
*/
|
||||
public function getAvatarAttr($value)
|
||||
{
|
||||
return trim($value) ? FileService::getFileUrl($value) : '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取器-性别描述
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string|string[]
|
||||
* @author 段誉
|
||||
* @date 2022/9/7 15:15
|
||||
*/
|
||||
public function getSexAttr($value, $data)
|
||||
{
|
||||
return UserEnum::getSexDesc($value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 登录时间
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2022/9/23 18:15
|
||||
*/
|
||||
public function getLoginTimeAttr($value)
|
||||
{
|
||||
return $value ? date('Y-m-d H:i:s', $value) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 生成用户编码
|
||||
* @param string $prefix
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 段誉
|
||||
* @date 2022/9/16 10:33
|
||||
*/
|
||||
public static function createUserSn($prefix = '', $length = 8)
|
||||
{
|
||||
$rand_str = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$rand_str .= mt_rand(1, 9);
|
||||
}
|
||||
$sn = $prefix . $rand_str;
|
||||
if (User::where(['sn' => $sn])->find()) {
|
||||
return self::createUserSn($prefix, $length);
|
||||
}
|
||||
return $sn;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
30
app/common/model/user/UserAccountLog.php
Normal file
30
app/common/model/user/UserAccountLog.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\user;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 账户流水记录模型
|
||||
* Class AccountLog
|
||||
* @package app\common\model\user
|
||||
*/
|
||||
class UserAccountLog extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
}
|
||||
27
app/common/model/user/UserAuth.php
Normal file
27
app/common/model/user/UserAuth.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\user;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 用户授权表
|
||||
* Class UserAuth
|
||||
* @package app\common\model
|
||||
*/
|
||||
class UserAuth extends BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
28
app/common/model/user/UserSession.php
Normal file
28
app/common/model/user/UserSession.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\common\model\user;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 用户登录token信息
|
||||
* Class UserSession
|
||||
* @package app\common\model\user
|
||||
*/
|
||||
class UserSession extends BaseModel
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user