123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\command;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- use think\facade\Cache;
- class HandleDataScreen extends Command
- {
- private $redis_hash_key = 'data_screen_wsm';
- protected function configure()
- {
- $this->setName('handle_data_screen')
- ->setDescription('处理数据大屏的统计数据');
- }
- protected function execute(Input $input, Output $output)
- {
- $key = 'wfwfwf';
- // $data = [
- // 'a'=>[
- // ['name'=>'a','age'=>3],
- // ['name'=>'b','age'=>4],
- // ],
- // 'bb'=>'bbbb',
- // 'ccc'=>['item'=>9999]
- // ];
- $redis = Cache::store('redis')->handler();
- $rs = $redis->hmset($key,['name'=>'张三','age'=>23]);
- $a = $redis->hget($key,'name');
- $all = $redis->hgetall($key);
- halt($rs,$a,$all);
- }
- }
|