isMobile() && config('ds_config.h5_force_redirect')){ $this->isHomeUrl(); } $this->template_dir = 'default/mall/'. strtolower(request()->controller()).'/'; } /** * 手机端访问自动跳转 */ protected function isHomeUrl(){ $controller = request()->controller();//取控制器名 $action = request()->action();//取方法名 $input = request()->param();//取参数 $param = http_build_query($input);//将参数转换成链接形式 if ($controller == 'Goods' && $action == 'index'){//商品详情 header('Location:'.config('ds_config.h5_site_url').'/goodsdetail?'.$param); exit; }elseif ($controller == 'Showgroupbuy' && $action == 'index'){//抢购列表 header('Location:'.config('ds_config.h5_site_url').'/groupbuy_list'); exit; }elseif ($controller == 'Search' && $action == 'index'){//搜索 header('Location:'.config('ds_config.h5_site_url').'/goodslist'); exit; }elseif ($controller == 'Showgroupbuy' && $action == 'groupbuy_detail'){//抢购详情 $goods_id = model('groupbuy')->getGroupbuyOnlineInfo(array(array('groupbuy_id' ,'=', $input['group_id'])))['goods_id']; header('Location:'.config('ds_config.h5_site_url').'/goodsdetail?goods_id='.$goods_id); exit; }elseif ($controller == 'Store' && $action == 'goods_all'){//店铺商品列表 header('Location:'.config('ds_config.h5_site_url').'/store_goodslist?'.$param); exit; }elseif ($controller == 'Category' && $action == 'goods'){//分类 header('Location:'.config('ds_config.h5_site_url').'/goodsclass'); exit; }else { header('Location:'.config('ds_config.h5_site_url'));exit;//其它页面跳转到首页 } } public function getSimpleName($name) { $simple = ''; if ($name == 'Central State University') { $simple = 'CSU'; } if ($name == 'Northern Arizona University') { $simple = 'NAU'; } if ($name == 'University of California, Berkeley') { $simple = 'UC Berkeley'; } if ($name == 'Olympic College') { $simple = 'OC'; } if ($name == 'California State Polytechnic University, Pomona') { $simple = 'CPP'; } if ($name == 'McGill University') { $simple = 'McGill'; } if ($name == 'University of Florida') { $simple = 'UFL'; } if ($name == 'University of New Brunswick') { $simple = 'UNB'; } if ($name == 'Arizona State University') { $simple = 'ASU'; } if ($name == "Thompson Rivers University") { $simple = 'TRU'; } if ($name == 'Colorado State University Pueblo') { $simple = 'CSU Pueblo'; } if ($name == 'San Francisco State University') { $simple = 'SFSU'; } if ($name == 'San Diego State University') { $simple = 'SDSU'; } if ($name == 'University of Wisconsin-Green Bay') { $simple = 'UWGB'; } if ($name == 'Trine University') { $simple = 'Trine'; } if ($name == 'Fulton-Montgomery Community College') { $simple = 'FMCC'; } if ($name == 'Ryerson University') { $simple = 'Ryerson'; } if ($name == 'Sichuan University') { $simple = 'SCU'; } return $simple; } } ?>