public function getJson() { $news = cache_remember('p.getJson.news.' . user('major'), function () { $news = new \app\models\News(); return json_encode($news->getNewsList()); }); $user = cache_remember('user.get.members.' . user('major'), function () { $user = new \app\models\User(); return json_encode($user->getMembers(true)); }); $gbnews = cache_remember('home.gbnews', function () { $gbnews = new \app\models\GbNews(); return json_encode($gbnews->lists(6)); }); echo '{ "news":' . $news . ', "users":' . $user . ', "gbnews":' . $gbnews . ' }'; }