get($type), true); return app('json')->successful('ok', $board); } /** * 读库 */ protected function daily_win_money() { $board = new UserBoard(); $res = $board->getDailyWinMoney(); foreach ($res as &$row) { $row['value'] = floatval($row['value']); $row['border'] = 0; $row['vip'] = 0; } return array( 'banner' => Config::get('app.leader_board_banner'), 'name' => "日榜", 'board' => $res, ); } /** * 缓存数据库取得的排行结果,定时调用 */ public function cache_board() { $res = (new BoardRds)->set(BoardRds::DAILY, json_encode($this->daily_win_money())); if (!$res) { errlog("cache_board() returned $res"); } } }