Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 4.0.9.0
- * @ Author : DeZender
- * @ Release on : 08.08.2019
- * @ Official site : http://DeZender.Net
- *
- */
- namespace app\index\controller;
- class Common extends \think\Controller
- {
- protected $site;
- protected $siteId = 0;
- protected $user;
- protected $info;
- protected $theme;
- protected $url = 'http://usbyun.cn';
- public function initialize()
- {
- $site = \app\admin\model\Site::where('rootDomain', 'like', '%' . $this->request->rootDomain() . '%')->where('state', 1)->find();
- $mainSite = \app\admin\model\Site::where('id', 0)->find();
- if (!empty($site)) {
- $this->site = $site;
- }
- else {
- $this->checkExpire();
- $subDomain = $this->request->subDomain();
- if (empty($subDomain) || (strtolower($subDomain) == 'www')) {
- $this->site = $mainSite;
- }
- else {
- $this->site = \app\admin\model\Site::where('subDomain', $subDomain)->where('state', 1)->find();
- if (empty($this->site)) {
- abort(404, '分站不存在,或分站已被停用');
- }
- }
- }
- if (empty($this->site['notice'])) {
- $this->site['notice'] = $mainSite['notice'];
- }
- if (empty($this->site['img1'])) {
- $this->site['img1'] = $mainSite['img1'];
- }
- if (empty($this->site['img2'])) {
- $this->site['img2'] = $mainSite['img2'];
- }
- if (empty($this->site['img3'])) {
- $this->site['img3'] = $mainSite['img3'];
- }
- $this->siteId = $this->site['id'];
- $notice = explode("\n", $this->site['notice']);
- $noticeStr = '';
- foreach ($notice as $key => $value) {
- $noticeStr .= '<p>' . $value . '</p>';
- }
- $alert = explode("\n", $this->site['alert']);
- $alertStr = '';
- if (!empty($alert)) {
- foreach ($alert as $key => $value) {
- $alertStr .= '<p>' . $value . '</p>';
- }
- }
- $alertStr = str_replace('<p></p>', '', $alertStr);
- $this->site['notice'] = $noticeStr;
- $this->site['alert'] = $alertStr;
- $user = \think\facade\Cookie::get($this->site['subDomain']);
- if (!empty($user)) {
- $map = [
- ['substation_id', '=', $this->siteId],
- ['nickname', '=', $user['nickname']],
- ['password', '=', $user['password']]
- ];
- $this->user = \think\Db::name('user')->where($map)->find();
- if ($user) {
- $this->assign('user', $this->user);
- }
- }
- $this->assign('siteId', $this->siteId);
- $this->info = \app\admin\model\SiteSetting::get(1);
- $this->assign('info', $this->info);
- $this->assign('site', $this->site);
- $this->assign('sys', $mainSite);
- $this->theme = strtolower($this->site['theme'] . '/' . $this->request->controller() . '/' . $this->request->action());
- }
- protected function sendEmail($orderId)
- {
- $order = \app\admin\model\Order::where('id|orderid', '=', $orderId)->find();
- $order->kami = nl2br($order->kami);
- ........................................................................
- ............................................
- .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement