* @version : HUOSDK 8.0 */ namespace huo\model\oa; use huo\model\common\CommonModel; use huo\model\game\GameModel; class OaGameModel extends CommonModel { protected $name = 'oa_game'; /** * @return \think\model\relation\BelongsTo */ public function game() { return $this->belongsTo(GameModel::className(), 'app_id', 'id')->field('id,name'); } /** * 更新游戏 * * @param array $ge_data * @param string $app_id * * @return bool */ public function updateData($ge_data, $app_id) { $_map['app_id'] = $app_id; $_data = $ge_data; $_rs = self::update($_data, $_map, true); if (false == $_rs) { return false; } else { $_game_model=new GameModel(); $_game_model->updateOaGame($app_id,$_data); return true; } } /** * 获取游戏扩信息 * * @param int $app_id * * @return false|array */ public function getDetail($app_id) { $_map['app_id'] = $app_id; $_data = $this->where($_map)->find(); if (is_object($_data)) { $_data = $_data->toArray(); } if (false == $_data) { return false; } return $_data; } }