WebLanguage.php
652 字节
<?php
/**
* @remark :
* @name :WebLanguage.php
* @author :lyh
* @method :post
* @time :2023/11/30 10:50
*/
namespace App\Models\WebSetting;
use App\Models\Base;
use Illuminate\Support\Facades\Cache;
class WebLanguage extends Base
{
protected $table = 'gl_web_language';
/**
* @param $id
* @return mixed
* @author zbj
* @date 2023/12/11
*/
public static function getLangById($id){
$cache_key = 'lang_'.$id;
$lang = Cache::get($cache_key);
if(!$lang){
$lang = self::find($id);
Cache::put($cache_key, $lang, 7200);
}
return $lang;
}
}