Files
dafuweng-saiadmin6.x/server/app/dice/model/config/DiceConfig.php
zhenhui dd264b1e97 1.将部门修改为渠道,并且所有dice_表关联渠道表
2.将所有配置表,记录表设置关联渠道
3.优化后台页面设置
2026-05-19 09:49:02 +08:00

84 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\dice\model\config;
use app\dice\model\DiceModel;
/**
* 摇色子配置模型
*
* dice_config 摇色子配置
*
* @property $id ID
* @property $name 配置名称
* @property $group 分组
* @property $title 标题
* @property $title_en 标题(英文)
* @property $value 值
* @property $value_en 值(英文)
* @property $create_time 创建时间
* @property $update_time 修改时间
*/
class DiceConfig extends DiceModel
{
/**
* 数据表主键
* @var string
*/
protected $primaryKey = 'id';
/**
* 数据库表名称
* @var string
*/
protected $table = 'dice_config';
/**
* 是否自动维护 create_time / update_time继承基类 CREATED_AT / UPDATED_AT
* @var bool
*/
public $timestamps = true;
/**
* 属性转换
*/
protected function casts(): array
{
return array_merge(parent::casts(), [
]);
}
/**
* 配置名称 搜索
*/
public function searchNameAttr($query, $value)
{
$query->where('name', 'like', '%'.$value.'%');
}
/**
* 分组 搜索
*/
public function searchGroupAttr($query, $value)
{
if ($value === '' || $value === null) {
return;
}
$query->where('group', '=', $value);
}
/**
* 标题 搜索
*/
public function searchTitleAttr($query, $value)
{
if ($value === '' || $value === null) {
return;
}
$query->where('title', 'like', '%' . $value . '%');
}
}