|
@@ -6,8 +6,44 @@ use think\Db;
|
|
use Redis;
|
|
use Redis;
|
|
class Test
|
|
class Test
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ public function showredis(){
|
|
|
|
+ $list = Db::name('user')->order('id desc')->column('id');
|
|
|
|
+ foreach($list as $key => $id){
|
|
|
|
+ dump($id.':'.redis_matching_get($id));
|
|
|
|
+ echo '<br/>';
|
|
|
|
+ }
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function clearredis(){
|
|
|
|
+ $list = Db::name('user')->order('id desc')->column('id');
|
|
|
|
+ foreach($list as $key => $id){
|
|
|
|
+ $a = redis_matching_set($id,0);
|
|
|
|
+ }
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function test1(){
|
|
|
|
+
|
|
|
|
+ $buffer1 = 'abcdefghijklmn';
|
|
|
|
+
|
|
|
|
+ $buffer2 = '{"type":"say", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello", "content":"hello"}'."";
|
|
|
|
+
|
|
|
|
+ $buffer2 = 'abcdefghijklmn'."\n";
|
|
|
|
|
|
- public function dellivebc(){
|
|
+
|
|
|
|
+ $client = stream_socket_client('tcp://1.14.197.70:2349');
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ fwrite($client, $buffer2);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function show_livebc(){
|
|
$party_id = input('party_id');
|
|
$party_id = input('party_id');
|
|
if(empty($party_id)){
|
|
if(empty($party_id)){
|
|
$this->error();
|
|
$this->error();
|
|
@@ -20,7 +56,8 @@ class Test
|
|
$a = $redis->get("livebc_".$party_id);
|
|
$a = $redis->get("livebc_".$party_id);
|
|
dump($a);
|
|
dump($a);
|
|
}
|
|
}
|
|
- public function outlivebc(){
|
|
+
|
|
|
|
+ public function show_livebc_jewel(){
|
|
$party_id = input('party_id');
|
|
$party_id = input('party_id');
|
|
if(empty($party_id)){
|
|
if(empty($party_id)){
|
|
$this->error();
|
|
$this->error();
|
|
@@ -56,15 +93,19 @@ class Test
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
public function clear(){
|
|
public function clear(){
|
|
- $paery_id = 54;
|
|
+ $party_id = input('party_id');
|
|
|
|
+ if(empty($party_id)){
|
|
|
|
+ $this->error();
|
|
|
|
+ }
|
|
|
|
|
|
$redis = new Redis();
|
|
$redis = new Redis();
|
|
$redisconfig = config("redis");
|
|
$redisconfig = config("redis");
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
- $redis->del('livebc_jewel_to_' . $paery_id);
|
|
+ $redis->del('livebc_jewel_to_' . $party_id);
|
|
- $redis->del('livebc_jewel_get_' . $paery_id);
|
|
+ $redis->del('livebc_jewel_get_' . $party_id);
|
|
- $redis->hDel("user_jewel_top3",$paery_id);
|
|
+ $redis->hDel("user_jewel_top3",$party_id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|