[色子游戏]底注配置
This commit is contained in:
48
server/app/dice/model/ante_config/DiceAnteConfig.php
Normal file
48
server/app/dice/model/ante_config/DiceAnteConfig.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | saiadmin [ saiadmin快速开发框架 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: your name
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\dice\model\ante_config;
|
||||
|
||||
use plugin\saiadmin\basic\think\BaseModel;
|
||||
|
||||
/**
|
||||
* 底注配置模型
|
||||
*
|
||||
* @property int $id ID
|
||||
* @property string $name 名称
|
||||
* @property string $title 标题
|
||||
* @property int $is_default 是否默认底注:0否 1是(全表仅允许一条为1)
|
||||
* @property int $mult 底注倍率
|
||||
* @property string $create_time 创建时间
|
||||
* @property string $update_time 更新时间
|
||||
*/
|
||||
class DiceAnteConfig extends BaseModel
|
||||
{
|
||||
protected $pk = 'id';
|
||||
|
||||
protected $table = 'dice_ante_config';
|
||||
|
||||
public function searchNameAttr($query, $value): void
|
||||
{
|
||||
if ($value !== '' && $value !== null) {
|
||||
$query->where('name', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
public function searchTitleAttr($query, $value): void
|
||||
{
|
||||
if ($value !== '' && $value !== null) {
|
||||
$query->where('title', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
public function searchIsDefaultAttr($query, $value): void
|
||||
{
|
||||
if ($value !== '' && $value !== null) {
|
||||
$query->where('is_default', (int) $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user