xxxrrrdddd 3 年之前
父節點
當前提交
0d10b03914
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      application/common/model/Area.php

+ 7 - 1
application/common/model/Area.php

@@ -134,7 +134,13 @@ class Area extends Model
         if(!$id){
             return '';
         }
-        return implode('',self::whereIn('id',$id)->column('name'));
+        $cacheName='area_'.serialize($id);
+        $res=Cache::get($cacheName);
+        if(!$res){
+            $res=implode('',self::whereIn('id',$id)->column('name'));
+            Cache::set($cacheName,$res,0);
+        }
+        return $res;
     }
 
     public static function shouldSend($county_id){