12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\index\controller;
- use app\common\controller\Frontend;
- use think\Db;
- class Index extends Frontend
- {
- protected $noNeedLogin = '*';
- protected $noNeedRight = '*';
- protected $layout = '';
- public function showredis(){
- $list = Db::name('user')->order('id desc')->column('id');
- foreach($list as $key => $id){
- dump($id.':'.redis_matching_get($id));
- }
- 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";
- $client = stream_socket_client('tcp://1.14.197.70:2349');
-
- fwrite($client, $buffer2);
- }
- public function index()
- {
- return $this->view->fetch();
- }
-
- public function appdownload() {
- if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
- header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
- }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
-
-
- $this->view->assign('downurl', 'baidu.com');
- return $this->view->fetch();
- }else{
- $this->view->assign('downurl', 'baidu.com');
- return $this->view->fetch();
- }
- }
- }
|