ask('选择期数?'); $type = $this->choice('【分配对象】 请选择执行操作', [ 'check' => '检验', 'baocun' => '保存', 'luodan' => '落单', 'data' => 'data' ]); $checkService = new CheckService(); switch ($type) { case 'baocun': $checkService->baocun($stage_id); break; case 'check': $errors = $checkService->check($stage_id); dump($errors); break; case "luodan": $uid = $this->ask('请输入uid?'); $pair = PairModel::where('uid', $uid)->where('stage_id', $stage_id)->first(); $errors = $checkService->luodan($pair); break; case "data": $this->__data(); break; } } private function __data() { $pairs = Redis::ZRANGE('pair:data', 0, -1, 'WITHSCORES'); foreach ($pairs as $key => $pair_id) { $data = json_decode($key); $user = $data->user; $other = $data->other; $pair = $data->pair; if ($pair->score > 90) { echo $pair->uid . ","; } } } }