get(okeys::GetRobotUserList()); if(!empty($userList)){ $userList = json_decode($userList,true); if(!empty($userList)&&is_array($userList)){ return $userList; } } $tb = otable::Robot(); $sql = "SELECT * FROM {$tb} WHERE 1"; $ret = oo::commonOprDb('api')->getAll($sql,1); $robot = []; foreach ($ret as $row){ $robot[] = $row['uid']; } oo::commonOprRedis('common')->set(okeys::GetRobotUserList(),json_encode($robot)); return $robot; } /** * 设置机器人金钱排行 * Created by: Owen * Created on: 2019/7/24 17:47 * Description: */ public function rankRobot(){ $robot = self::getAllRobot(); $InUid = implode(',',$robot); $ghtable = otable::gh_gameserver(1); $sql = "SELECT * FROM {$ghtable} WHERE mid IN ({$InUid})"; $ret = oo::commonOprDb('ghgames')->getAll($sql,MYSQLI_ASSOC); foreach ($ret as $row){ oo::commonOprRedis('common')->zAdd(okeys::rankRobot(),$row['money'],$row['mid']); } } }