$game_id])->find()->toArray(); if (empty($info)) { return false; } // $info['time'] = time(); Cache::tag(self::CACHE_TAG)->set($cache_key, $info, 3600); } return $info; } /** * 根据 app_id 获取配置信息 * @param $app_id * * @return array|false|mixed * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public static function getInfoByAppId($app_id) { if (empty($app_id)) { return []; } $cache_key = self::CACHE_KEY.$app_id; $info = Cache::get($cache_key); if (empty($info)) { $info = self::where(['app_id' => $app_id])->find()->toArray(); if (empty($info)) { return false; } Cache::tag(self::CACHE_TAG)->set($cache_key, $info, 3600); } return $info; } }