CountryCustom.php 855 字节
<?php

namespace App\Models\Project;

use App\Models\Base;
use App\Models\WebSetting\WebSetting;
use Illuminate\Database\Eloquent\SoftDeletes;

class CountryCustom extends Base
{
    use SoftDeletes;

    protected $table = 'gl_project_country_custom';


    public static function getCountryCustomByProjectId($projectId){
        if (Redis::get("project_" . $projectId . "_country_custom") == null) {
            $countryCustomInfo = self::with("countryCustomLanguage")->where("project_id",$projectId)->where("status",1)->where("is_create",1)->get();
            Redis::set("project_" . $projectId . "_country_custom", json_encode($countryCustomInfo));
            Redis::expire("project_" . $projectId . "_country_custom", WebSetting::$redisExpireTime);
        }
        return json_decode(Redis::get("project_".$projectId."_country_custom"));
    }
}