Ken 1 月之前
父节点
当前提交
c8bca638bb
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Services/FixtureService.php

+ 2 - 2
app/Services/FixtureService.php

@@ -25,7 +25,7 @@ static function odds(int|string $id)
         $res = Client::odds(['fixture' => $id]);
         if (count($res['response']) <= 0) return [];
         $res = $res['response'][0];
-        Cache::put($key, $res, now()->addHours(3));
+        Cache::put($key, json_encode($res), now()->addHours(3));
         return $res;
     }
 
@@ -43,7 +43,7 @@ static function oddsLive($id)
         $res = Client::oddsLive(['fixture' => $id]);
         if (count($res['response']) <= 0) return [];
         $res = $res['response'][0];
-        Cache::put($key, $res, 5);
+        Cache::put($key, json_encode($res), 5);
         return $res;
     }