|
|
@ -204,7 +204,6 @@ class GameController extends ThinkController
|
|
|
|
$_POST['detail_content'] = '';
|
|
|
|
$_POST['detail_content'] = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pinyin = new \Think\Pinyin();
|
|
|
|
$pinyin = new \Think\Pinyin();
|
|
|
|
$num = mb_strlen($_POST['game_name'], 'UTF8');
|
|
|
|
$num = mb_strlen($_POST['game_name'], 'UTF8');
|
|
|
|
$short = '';
|
|
|
|
$short = '';
|
|
|
@ -224,6 +223,14 @@ class GameController extends ThinkController
|
|
|
|
if (!$res) {
|
|
|
|
if (!$res) {
|
|
|
|
$this->error($game->getError());
|
|
|
|
$this->error($game->getError());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$baseData = [
|
|
|
|
|
|
|
|
'id' => $res['id'],
|
|
|
|
|
|
|
|
'name' => str_replace('(安卓版)', '', str_replace('(苹果版)', '', $_POST['game_name'])),
|
|
|
|
|
|
|
|
'sdk_version' => $_POST['sdk_version'],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$gameService->saveBaseGame($baseData);
|
|
|
|
|
|
|
|
|
|
|
|
\Think\Log::actionLog('Game/add', 'Game', 1);
|
|
|
|
\Think\Log::actionLog('Game/add', 'Game', 1);
|
|
|
|
//操作日志
|
|
|
|
//操作日志
|
|
|
|
addOperationLog(array(
|
|
|
|
addOperationLog(array(
|
|
|
@ -231,7 +238,7 @@ class GameController extends ThinkController
|
|
|
|
"key"=>$_POST['game_name'],
|
|
|
|
"key"=>$_POST['game_name'],
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$_POST['game_name']))
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$_POST['game_name']))
|
|
|
|
));
|
|
|
|
));
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists'));
|
|
|
|
$this->success($_POST['id'] ? '更新成功' : '新增成功', U('lists'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ($_GET['type'] == 1 || $_GET['type'] == "") {
|
|
|
|
if ($_GET['type'] == 1 || $_GET['type'] == "") {
|
|
|
@ -242,8 +249,6 @@ class GameController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
$this->m_title = '游戏列表';
|
|
|
|
$this->m_title = '游戏列表';
|
|
|
|
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Game/lists', 'status' => 1])->find());
|
|
|
|
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Game/lists', 'status' => 1])->find());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -288,12 +293,22 @@ class GameController extends ThinkController
|
|
|
|
if (!$res) {
|
|
|
|
if (!$res) {
|
|
|
|
$this->error($game->getError());
|
|
|
|
$this->error($game->getError());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$gameService = new GameService();
|
|
|
|
|
|
|
|
$baseData = [
|
|
|
|
|
|
|
|
'id' => $res['id'],
|
|
|
|
|
|
|
|
'name' => str_replace('(安卓版)', '', str_replace('(苹果版)', '', $_POST['game_name'])),
|
|
|
|
|
|
|
|
'sdk_version' => $_POST['sdk_version'],
|
|
|
|
|
|
|
|
'relation_game_id' => $_POST['relation_game_id'],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$gameService->saveBaseGame($baseData);
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog(array(
|
|
|
|
addOperationLog(array(
|
|
|
|
"op_type"=>0,
|
|
|
|
"op_type"=>0,
|
|
|
|
"key"=>$_POST['game_name'],
|
|
|
|
"key"=>$_POST['game_name'],
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$_POST['game_name']))
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$_POST['game_name']))
|
|
|
|
));
|
|
|
|
));
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists'));
|
|
|
|
$this->success($_POST['id'] ? '更新成功' : '新增成功', U('lists'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$_REQUEST['id'] || $this->error('id不能为空');
|
|
|
|
$_REQUEST['id'] || $this->error('id不能为空');
|
|
|
@ -399,6 +414,15 @@ class GameController extends ThinkController
|
|
|
|
$sid = $sibling['id'];
|
|
|
|
$sid = $sibling['id'];
|
|
|
|
$map['id'] = array('neq', $sid);
|
|
|
|
$map['id'] = array('neq', $sid);
|
|
|
|
$another = D("Game")->where($map)->find(); //获取另一个所有
|
|
|
|
$another = D("Game")->where($map)->find(); //获取另一个所有
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$baseData = [
|
|
|
|
|
|
|
|
'id' => $id,
|
|
|
|
|
|
|
|
'name' => str_replace('(安卓版)', '', str_replace('(苹果版)', '', $sibling['game_name'])),
|
|
|
|
|
|
|
|
'relation_game_id' => $another ? $another['id'] : 0,
|
|
|
|
|
|
|
|
'sdk_version' => $sibling['sdk_version'],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$gameService->saveBaseGame($baseData);
|
|
|
|
|
|
|
|
|
|
|
|
$phone['apply_auth'] = $sibling['apply_auth'];
|
|
|
|
$phone['apply_auth'] = $sibling['apply_auth'];
|
|
|
|
$phone['game_type_id'] = $sibling['game_type_id'];
|
|
|
|
$phone['game_type_id'] = $sibling['game_type_id'];
|
|
|
|
$phone['dow_num'] = $sibling['dow_num'];
|
|
|
|
$phone['dow_num'] = $sibling['dow_num'];
|
|
|
@ -444,7 +468,7 @@ class GameController extends ThinkController
|
|
|
|
"key"=>$sibling ['game_name'],
|
|
|
|
"key"=>$sibling ['game_name'],
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$sibling ['game_name']))
|
|
|
|
"url"=>U("Game/lists",array("game_name"=>$sibling ['game_name']))
|
|
|
|
));
|
|
|
|
));
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists', array('type' => I('post.type'), 'p' => I('request.p'))));
|
|
|
|
$this->success($_POST['id'] ? '更新成功' : '新增成功', U('lists', array('type' => I('post.type'), 'p' => I('request.p'))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|