From 4a3ce9d656579a08ac32f08d59a82bb70cf00bf0 Mon Sep 17 00:00:00 2001
From: Martin Zhou <1009465756@qq.com>
Date: Mon, 25 Jan 2016 10:53:12 +0800
Subject: [PATCH] fix bug 2016/01/25
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复引起前台个人中心显示异常的BUG
---
Application/User/Controller/ChangeController.class.php | 3 +++
Application/User/Controller/ForgetController.class.php | 3 +++
Application/User/Controller/GiftController.class.php | 6 ++++++
Application/User/Controller/InfoController.class.php | 3 +++
Application/User/Controller/PostController.class.php | 9 +++++++++
Application/User/Controller/RegController.class.php | 3 +++
Application/User/View/Gift/add.html | 2 +-
7 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/Application/User/Controller/ChangeController.class.php b/Application/User/Controller/ChangeController.class.php
index 39c330d..f7c77a0 100644
--- a/Application/User/Controller/ChangeController.class.php
+++ b/Application/User/Controller/ChangeController.class.php
@@ -17,6 +17,9 @@ class ChangeController extends BaseController{
*/
public function index()
{
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->display();
}
diff --git a/Application/User/Controller/ForgetController.class.php b/Application/User/Controller/ForgetController.class.php
index d5a3c0b..e7e6e80 100644
--- a/Application/User/Controller/ForgetController.class.php
+++ b/Application/User/Controller/ForgetController.class.php
@@ -12,6 +12,9 @@ use Think\Controller;
class ForgetController extends Controller {
//显示找回密码页面
public function index(){
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->display();
}
//找回密码逻辑
diff --git a/Application/User/Controller/GiftController.class.php b/Application/User/Controller/GiftController.class.php
index 030e0c3..c7f7f69 100644
--- a/Application/User/Controller/GiftController.class.php
+++ b/Application/User/Controller/GiftController.class.php
@@ -13,6 +13,9 @@ class GiftController extends BaseController{
public function index(){
$gift = M('links')->select();
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->assign('gift',$gift);
$this->display();
}
@@ -23,6 +26,9 @@ class GiftController extends BaseController{
$id = session('userId');
$gid = I('get.gid',0,'intval');
if (!IS_POST) {
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$info = M('info')->where('user_id='.$id)->select();
$gift = M('links')->where('id='.$gid)->select();
$this->assign('info',$info);
diff --git a/Application/User/Controller/InfoController.class.php b/Application/User/Controller/InfoController.class.php
index 453d769..9a86c4e 100644
--- a/Application/User/Controller/InfoController.class.php
+++ b/Application/User/Controller/InfoController.class.php
@@ -13,7 +13,10 @@ class InfoController extends BaseController{
public function index(){
$id = session('userId');
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
$info = M('info')->where('user_id='.$id)->select();
+ $this->assign('title', $title);
$this->assign('info',$info);
$this->display();
}
diff --git a/Application/User/Controller/PostController.class.php b/Application/User/Controller/PostController.class.php
index 78fe084..0a63d8a 100644
--- a/Application/User/Controller/PostController.class.php
+++ b/Application/User/Controller/PostController.class.php
@@ -32,6 +32,9 @@ class PostController extends BaseController
$Page = new \Extend\Page($count,15);// 实例化分页类 传入总记录数和每页显示的记录数(15)
$show = $Page->show();// 分页显示输出
$post = $model->limit($Page->firstRow.','.$Page->listRows)->where($where)->order('post.id DESC')->where('user_id='.$id)->select();
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->assign('model', $post);
$this->assign('page',$show);
$this->display();
@@ -43,6 +46,9 @@ class PostController extends BaseController
{
//默认显示添加表单
if (!IS_POST) {
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->assign("category",getSortedCategory(M('category')->select()));
$this->display();
}
@@ -73,6 +79,9 @@ class PostController extends BaseController
$rid = I('get.rid',0,'intval');
$model = M("Post");
$post = $model->where('user_id='.$id)->where('id='.$rid)->find();
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->assign('model', $post);
$this->display();
}
diff --git a/Application/User/Controller/RegController.class.php b/Application/User/Controller/RegController.class.php
index 1bea1f9..fdbd147 100644
--- a/Application/User/Controller/RegController.class.php
+++ b/Application/User/Controller/RegController.class.php
@@ -20,6 +20,9 @@ class RegController extends Controller{
*/
public function index()
{
+ $tmodel= M('setting');
+ $title = $tmodel->where('id=1')->select();
+ $this->assign('title', $title);
$this->display();
}
diff --git a/Application/User/View/Gift/add.html b/Application/User/View/Gift/add.html
index 786422f..d6d57f8 100644
--- a/Application/User/View/Gift/add.html
+++ b/Application/User/View/Gift/add.html
@@ -36,7 +36,7 @@