request->server("HTTP_SID")); } parent::_initialize(); Auth::instance()->setAllowFields($this->allowFields); // 查询是否是审核员 $user = Auth::instance()->getUser(); $isInspection = null; if ($user) { $isInspection = InspectionService::getUserApplication($user->id); if (!$isInspection) { $this->error('您不是审核员'); } // 验证是否 通过 if ($isInspection->audit_status !== InspectionApplication::AUDIT_STATUS_PASSED) { $this->error('您的验货员申请未通过'); } } $this->application = $isInspection; //这里手动载入语言包 Lang::load(ROOT_PATH . '/addons/shop/lang/zh-cn.php'); Lang::load(APP_PATH . '/index/lang/zh-cn/user.php'); //加载当前控制器的语言包 $controllername = strtolower($this->request->controller()); $lang = $this->request->langset(); $lang = preg_match("/^([a-zA-Z\-_]{2,10})\$/i", $lang) ? $lang : 'zh-cn'; Lang::load(ADDON_PATH . 'shop/lang/' . $lang . '/' . str_replace('.', '/', $controllername) . '.php'); } }