fix bug 2016/01/25

修复引起前台个人中心显示异常的BUG
This commit is contained in:
Martin Zhou
2016-01-25 10:53:12 +08:00
parent 723a65923c
commit 4a3ce9d656
7 changed files with 28 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -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();
}
//找回密码逻辑

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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();
}