|
@ -7,6 +7,7 @@ use App\Http\Services\CommonService; |
|
|
use Illuminate\Routing\Controller as BaseController; |
|
|
use Illuminate\Routing\Controller as BaseController; |
|
|
use Illuminate\Support\Facades\Cache; |
|
|
use Illuminate\Support\Facades\Cache; |
|
|
use Illuminate\Support\Facades\Log; |
|
|
use Illuminate\Support\Facades\Log; |
|
|
|
|
|
use Illuminate\Support\Facades\Redis; |
|
|
|
|
|
|
|
|
class IndexController extends BaseController |
|
|
class IndexController extends BaseController |
|
|
{ |
|
|
{ |
|
@ -263,7 +264,26 @@ class IndexController extends BaseController |
|
|
|
|
|
|
|
|
public function store() |
|
|
public function store() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
$time = time(); |
|
|
// echo Cache::get('pelma'); |
|
|
// echo Cache::get('pelma'); |
|
|
|
|
|
$pelma_key = "pelma:1"; |
|
|
|
|
|
|
|
|
|
|
|
//按时间添加 |
|
|
|
|
|
// Redis::zadd($pelma_key, $time, 'a' . $time); |
|
|
|
|
|
|
|
|
|
|
|
// Redis::zadd($pelma_key, 1, 'a' . $time); |
|
|
|
|
|
|
|
|
|
|
|
//删除过期 |
|
|
|
|
|
// Redis::ZREMRANGEBYSCORE($pelma_key, 0, ($time - 60)); |
|
|
|
|
|
|
|
|
|
|
|
//获取最大时间 |
|
|
|
|
|
// $data = Redis::ZREVRANGE($pelma_key, 0, 0); |
|
|
|
|
|
//获得指定时间 |
|
|
|
|
|
// $data = Redis::ZRANGEBYSCORE($pelma_key, 19, 29); |
|
|
|
|
|
|
|
|
|
|
|
// var_dump($data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = request('pelma'); |
|
|
$data = request('pelma'); |
|
|
Cache::put('pelma', $data); |
|
|
Cache::put('pelma', $data); |
|
|