123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- class Btoc extends Controller
- {
- public function index()
- {
- $post['name'] = 'ayy';
- $data['url'] = 'http://hm.hemadj.com/dev/test';
- $data['method'] = 'post';
- $data['data'] = $post;
- _curl($data);
- $result = $this->xtox('btoc');
- }
- public function xtox($listname){
- $redis = new \Redis();
- $redis->connect('39.97.239.116', 6379);
- $redis->auth('huaxiashangmeng');
- $redis->select(1);
- while(true){
- try{
- $value = $redis->BRPOP($listname,0);
- if(!$value){
- break;
- }
- return $value;
- }catch(Exception $e){
- return $e->getMessage();
- }
- }
- }
- }
|