HandleDataScreen.php 934 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\command;
  3. use think\console\Command;
  4. use think\console\Input;
  5. use think\console\Output;
  6. use think\facade\Cache;
  7. class HandleDataScreen extends Command
  8. {
  9. private $redis_hash_key = 'data_screen_wsm';
  10. protected function configure()
  11. {
  12. $this->setName('handle_data_screen')
  13. ->setDescription('处理数据大屏的统计数据');
  14. }
  15. protected function execute(Input $input, Output $output)
  16. {
  17. $key = 'wfwfwf';
  18. // $data = [
  19. // 'a'=>[
  20. // ['name'=>'a','age'=>3],
  21. // ['name'=>'b','age'=>4],
  22. // ],
  23. // 'bb'=>'bbbb',
  24. // 'ccc'=>['item'=>9999]
  25. // ];
  26. $redis = Cache::store('redis')->handler();
  27. $rs = $redis->hmset($key,['name'=>'张三','age'=>23]);
  28. $a = $redis->hget($key,'name');
  29. $all = $redis->hgetall($key);
  30. halt($rs,$a,$all);
  31. }
  32. }