浏览代码

清空redis

lizhen_gitee 3 年之前
父节点
当前提交
867c203f55
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      application/index/controller/Index.php

+ 2 - 2
application/index/controller/Index.php

@@ -12,7 +12,7 @@ class Index extends Frontend
     protected $layout = '';
 
     public function showredis(){
-        $list = Db::name('user')->column('id');
+        $list = Db::name('user')->order('id desc')->column('id');
         foreach($list as $key => $id){
             dump($id.':'.redis_matching_get($id));
         }
@@ -20,7 +20,7 @@ class Index extends Frontend
     }
 
     public function clearredis(){
-        $list = Db::name('user')->column('id');
+        $list = Db::name('user')->order('id desc')->column('id');
         foreach($list as $key => $id){
             $a = redis_matching_set($id,0);
         }