0){ return model('site')->getValue(['site_id'=>$site_id],'uniacid'); } return 0; } /** * 站点id add lucky * @param number $siteid */ public function siteid($siteid=0) { return session("site_id")?session("site_id"):0; } /** * 站点id * @param number $siteid */ /* public function siteid($siteid = 1) { return 1; }*/ /** * 当前访问插件 * @param string $addon * @return string */ public function addon($addon = '') { if (!empty($addon)) { $GLOBALS[ "REQUEST_ADDON" ] = $addon; } if (isset($GLOBALS[ "REQUEST_ADDON" ])) { return str_replace('shop.html', '', $GLOBALS[ "REQUEST_ADDON" ]); } } /** * 当前访问模块 * @param string $module */ public function module($module = '') { if (!empty($module)) { $GLOBALS[ "REQUEST_MODULE" ] = $module; } return $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(); } }