1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- /**
- * GameversionModel.php UTF-8
- * web
- *
- * @date : 2020/9/15 9:39
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : chenbingling <cbl@huosdk.com>
- * @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;
- }
- }
|