set_ad_message_cookie(); $regular_server = new \Common\Server\RegularServer(); $is_mobile = $regular_server->is_mobile_request(); if ($is_mobile == true) { $url = U('/m/about/join', array(),true, true); // $url = 'http://www.x-motion.cn/m/about/join/'; header('Location: ' . $url); die; } } public function _empty() { header("Location:" . U('/', '', true, true)); die; } /** * 设置广告来源缓存 * @author: linch */ private function set_ad_message_cookie() { $ad_code_name = \Common\Model\AdMessageModel::ad_code_name; $code = trim(I('get.' . $ad_code_name, '')); if (!empty($code)) { cookie($ad_code_name, $code); } } /** * 获取分页 * @author: linch * @param $count * @param $page_size * @param $page_num * @param array $param * @return array */ public function get_page($count, $page_size, $page_num, $param = array()){ $page_count = ceil($count / $page_size); $page = array( 'pre' => 0, 'next' => 0, ); if ($page_num > 1) { $param['p'] = $page_num - 1; $page['pre'] = U(CONTROLLER_NAME . '/' . ACTION_NAME, $param); } if ($page_num < $page_count) { $param['p'] = $page_num + 1; $page['next'] = U(CONTROLLER_NAME . '/' . ACTION_NAME, $param); } return $page; } }