refactor: 国家列表接口添加按名称搜索

This commit is contained in:
2025-03-25 16:50:58 +08:00
parent 5eff994559
commit 68d31fc9b1
2 changed files with 9 additions and 1 deletions

View File

@@ -10,5 +10,10 @@ use app\common\model\CountryBaseModel;
*/
class CountryModel extends CountryBaseModel
{
// 根据名称搜索
public function searchNameAttr($query, $value)
{
if (is_null($value)) return;
$query->where('name', 'like', '%' . $value . '%');
}
}