site_id=$siteid; // }else if($siteid=='' && $this->site_id==''){ // $this->site_id=input('site_id',1); // } $this->site_id = 1; return $this->site_id; } /** * 当前访问插件 * @param string $addon * @return string */ public function addon($addon = '') { if(!empty($addon)) { $GLOBALS["REQUEST_ADDON"] = $addon; } return isset($GLOBALS["REQUEST_ADDON"]) ? $GLOBALS["REQUEST_ADDON"] : ''; } /** * 当前访问模块 * @param string $module */ public function module($module = '') { if(!empty($module)) { $GLOBALS["REQUEST_MODULE"] = $module; } return isset($GLOBALS["REQUEST_MODULE"]) ? $GLOBALS["REQUEST_MODULE"] : ''; } /** * 判断当前是否是微信浏览器 */ public function isWeixin() { if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { return 1; } return 0; } /** * 当前登录用户id * @return mixed|number */ public function uid($app_module) { $uid = session($app_module."."."uid"); if(!empty($uid)) { return $uid; }else{ return 0; } } /** * 解析url */ public function parseUrl() { $addon = $this->addon() ? $this->addon() . '://' : ''; return $addon.$this->module().'/'.$this->controller().'/'.$this->action(); } }