优享精灵首码源码分享
class Promotion extends BaseApi
{
/**
* 获取营销游戏列表
*/
public function promotionGamesList()
{
$page_index = isset($this->params['page_index']) ? $this->params['page_index'] : 1;
$page_size = isset($this->params['page_size']) ? $this->params['page_size'] : 0;
$condition = isset($this->params['condition']) ? $this->params['condition'] : "";
$order = isset($this->params['order']) ? $this->params['order'] : "";
$promotion = new PromotionService();
$res = $promotion->getPromotionGamesList($page_index, $page_size, $condition, $order);
return $this->outMessage("获取营销游戏列表", $res);
}
/**
* 是否开启
*/
public function checkGameOpen()
{
$game_id = isset($this->params['game_id']) ? $this->params['game_id'] : "";
if (empty($this->uid)) {
$_SESSION['login_pre_url'] = __URL(\think\Config::get('view_replace_str.APP_MAIN') . "/Game/index?gid=" . $game_id);
$redirect = __URL(__URL__ . "/wap/login");
return $this->outMessage("判断是否开启", $redirect);
} else {
return $this->outMessage("判断是否开启", null, -1);
}
}
/**
* 游戏检测
*/
public function checkGame()
{
$promotion = new PromotionService();
$game_id = isset($this->params['game_id']) ? $this->params['game_id'] : "";
$gameDetail = $promotion->getPromotionGameDetail($game_id);
if (empty($gameDetail["game_id"])) {