|
|
|
@ -184,14 +184,14 @@ class GameController extends ThinkController
|
|
|
|
|
} else {
|
|
|
|
|
$_POST['display_site'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$content = $_POST['content'];
|
|
|
|
|
if(!empty($content)) {
|
|
|
|
|
if (!empty($content)) {
|
|
|
|
|
$_POST['detail_content'] = $content;
|
|
|
|
|
} else {
|
|
|
|
|
$_POST['detail_content'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pinyin = new \Think\Pinyin();
|
|
|
|
|
$num = mb_strlen($_POST['game_name'], 'UTF8');
|
|
|
|
@ -301,6 +301,7 @@ class GameController extends ThinkController
|
|
|
|
|
$_POST['display_site'] = '';
|
|
|
|
|
}
|
|
|
|
|
$content = $_POST['content'];
|
|
|
|
|
$gameRatio = M('Game', 'tab_')->where(array('id' => I('post.id', 0)))->getField('ratio');//游戏推广分成比例
|
|
|
|
|
$game = D(self::model_name);//M('$this->$model_name','tab_');
|
|
|
|
|
$_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount'];
|
|
|
|
|
$_POST['detail_content'] = $content;
|
|
|
|
@ -348,7 +349,17 @@ class GameController extends ThinkController
|
|
|
|
|
$this->error($game->getError());
|
|
|
|
|
} else {
|
|
|
|
|
\Think\Log::actionLog('Game/edit', 'Game', 1);
|
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists', array('type' => I('post.type'), 'p' => I('request.p'))));
|
|
|
|
|
$thisGameRatio = I('post.ratio', 0);
|
|
|
|
|
if ($gameRatio != $thisGameRatio) {
|
|
|
|
|
$spendRes = M('Spend', 'tab_')->where(array('game_id' => $id, 'pay_status' => 1, 'selle_status' => 0))->save(array('selle_ratio' => $thisGameRatio));
|
|
|
|
|
if ($spendRes === false) {
|
|
|
|
|
$this->error('更新成功,推广充值分成比例同步失败');
|
|
|
|
|
} else {
|
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists', array('type' => I('post.type'), 'p' => I('request.p'))));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$this->success($res['id'] ? '更新成功' : '新增成功', U('lists', array('type' => I('post.type'), 'p' => I('request.p'))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
@ -369,15 +380,15 @@ class GameController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
if (!empty($data['screenshot'])) {
|
|
|
|
|
$data['screenshot_data'] = explode(',', $data['screenshot']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!empty($data['cover'])) {
|
|
|
|
|
$data['cover_data'] = explode(',', $data['cover']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!empty($data['icon'])) {
|
|
|
|
|
if (!empty($data['icon'])) {
|
|
|
|
|
$data['icon_data'] = explode(',', $data['icon']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data['introduction'] = str_replace("~~", "\r\n", $data['introduction']);
|
|
|
|
|