12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /**
- * OaGameModel.php UTF-8
- * 游戏oa扩展 model
- *
- * @date : 2018/07/13 22:44
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : guxiannong <gxn@huosdk.com>
- * @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;
- }
- }
|