|
@@ -13,12 +13,15 @@ class Test extends Controller
|
|
|
{
|
|
{
|
|
|
public function index()
|
|
public function index()
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+ // 5秒更新一次
|
|
|
$list = $this->football('/odds/live');
|
|
$list = $this->football('/odds/live');
|
|
|
foreach ($list['response'] as $item) {
|
|
foreach ($list['response'] as $item) {
|
|
|
$sport = Sport::where('data_id', $item['fixture']['id'])->first();
|
|
$sport = Sport::where('data_id', $item['fixture']['id'])->first();
|
|
|
$sport->odds = json_encode($item['odds']);
|
|
$sport->odds = json_encode($item['odds']);
|
|
|
$sport->save();
|
|
$sport->save();
|
|
|
}
|
|
}
|
|
|
|
|
+ return $this->success($list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function football($api, $params = [])
|
|
function football($api, $params = [])
|