refactor: 修改语言接口
This commit is contained in:
@@ -32,7 +32,7 @@ class Language
|
||||
public function cutover()
|
||||
{
|
||||
$id = request()->param('id');
|
||||
$language = LanguageModel::id($id)->find();
|
||||
$language = LanguageModel::bypk($id)->find();
|
||||
if (is_null($language)) {
|
||||
return error('语言不存在');
|
||||
}
|
||||
|
||||
@@ -15,10 +15,4 @@ class LanguageModel extends LanguageBaseModel
|
||||
{
|
||||
return $this->belongsTo(CountryModel::class, 'country_id', 'id');
|
||||
}
|
||||
|
||||
// 根据id查询
|
||||
public function scopeId($query, $value)
|
||||
{
|
||||
$query->where('id', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user