ReInquiryConfig.php
901 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace App\Models\Inquiry;
use App\Models\Base;
use Illuminate\Support\Facades\Cache;
/**
* Class ReInquiryConfig
* @package App\Models\Inquiry
* @author zbj
* @date 2025/2/12
*/
class ReInquiryConfig extends Base
{
const TYPE_AI_PARAM = 'ai_param';
const TYPE_FILTER_WORDS = 'filter_words';
//设置关联表名
protected $table = 'gl_re_inquiry_config';
public static function getDefaultConfigCache($type){
$cache_key = 'ReInquiryDefaultConfigCache';
$data = Cache::get($cache_key);
if(!$data){
$data = self::all();
if($data){
Cache::put($cache_key, $data);
}
}
return $data->where('type', $type)->pluck('content', 'key');
}
public static function delCache(){
$cache_key = 'ReInquiryDefaultConfigCache';
Cache::forget($cache_key);
}
}