You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
779 B
43 lines
779 B
1 year ago
|
<?php
|
||
|
|
||
|
namespace app\model\system\lang;
|
||
|
|
||
|
use crmeb\basic\BaseModel;
|
||
|
use crmeb\traits\ModelTrait;
|
||
|
|
||
|
class LangCountry extends BaseModel
|
||
|
{
|
||
|
use ModelTrait;
|
||
|
|
||
|
/**
|
||
|
* 数据表主键
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $pk = 'id';
|
||
|
|
||
|
/**
|
||
|
* 模型名称
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $name = 'lang_country';
|
||
|
|
||
|
/**
|
||
|
* type_id搜索器
|
||
|
* @param $query
|
||
|
* @param $value
|
||
|
*/
|
||
|
public function searchTypeIdAttr($query, $value)
|
||
|
{
|
||
|
if ($value !== '') $query->where('type_id', $value);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* code/name搜索器
|
||
|
* @param $query
|
||
|
* @param $value
|
||
|
*/
|
||
|
public function searchKeywordAttr($query, $value)
|
||
|
{
|
||
|
if ($value !== '') $query->where('name|code', 'like', '%' . $value . '%');
|
||
|
}
|
||
|
}
|