|
|
@@ -5,10 +5,24 @@
|
|
|
use App\Models\Sport;
|
|
|
use App\Services\ApiFootball\Client;
|
|
|
use Carbon\Carbon;
|
|
|
+use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
class FixtureService extends BaseService
|
|
|
{
|
|
|
|
|
|
+ static function odds($id)
|
|
|
+ {
|
|
|
+ $key = "odds_{$id}";
|
|
|
+ $odds = Cache::get($key, null);
|
|
|
+ if ($odds) return json_decode($odds, true);
|
|
|
+ $res = Client::odds(['fixture'=>$id]);
|
|
|
+ return $res;
|
|
|
+// $res['']
|
|
|
+// $sport = Sport::where('data_id', $id)->first();
|
|
|
+// return $sport->odds;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 将进行中的赛事 更新赔率
|