- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
52 lines
1.0 KiB
PHP
52 lines
1.0 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\model\system;
|
|
|
|
use crmeb\basic\BaseModel;
|
|
use crmeb\traits\ModelTrait;
|
|
use think\Model;
|
|
|
|
/**
|
|
* 菜单关联模型
|
|
* Class SystemMenus
|
|
* @package app\model\system
|
|
*/
|
|
class SystemMenusRelevance extends BaseModel
|
|
{
|
|
use ModelTrait;
|
|
|
|
/**
|
|
* 数据表主键
|
|
* @var string
|
|
*/
|
|
protected $pk = 'id';
|
|
|
|
/**
|
|
* 模型名称
|
|
* @var string
|
|
*/
|
|
protected $name = 'system_menus_relevance';
|
|
|
|
public function searchMenuIdAttr($query, $value)
|
|
{
|
|
if (is_array($value)) {
|
|
$query->whereIn('menu_id', $value);
|
|
} else {
|
|
if ($value !== '') {
|
|
$query->where('menu_id', $value);
|
|
}
|
|
}
|
|
}
|
|
|
|
public function searchKeywordAttr($query, $value)
|
|
{
|
|
if ($value !== '') {
|
|
$query->whereLike('keyword', "%{$value}%");
|
|
}
|
|
}
|
|
|
|
}
|