* @version : H5IOS 1.0 */ namespace huosdk\h5ios\core\model; use huosdk\h5ios\core\constant\CommonConst; class GameversionModel extends \huo\model\game\GameversionModel { /** * 获取默认版本ID * * @param int $app_id 应用ID * * @return int */ public function getDefaultIdByAppId($app_id) { if (empty($app_id)) { return 0; } if (!empty($_id)) { return $_id; } /* 取默认 */ $_map = [ 'app_id' => $app_id, 'is_default' => CommonConst::CONST_DEFAULT, 'is_delete' => CommonConst::CONST_NOT_DELETE ]; $_id = $this->where($_map)->value('id'); if (empty($_id)) { return 0; } return $_id; } /** * 根据游戏ID获取默认信息 * * @param int $app_id 应用ID * * @return array|bool|false */ public function getDefaultInfoByAppId($app_id) { $_id = $this->getDefaultIdByAppId($app_id); if (empty($_id)) { return false; } $_data = $this->getInfoById($_id); return $_data; } }