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() public function index()
{ {
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$this->display(); $this->display();
} }

View File

@@ -12,6 +12,9 @@ use Think\Controller;
class ForgetController extends Controller { class ForgetController extends Controller {
//显示找回密码页面 //显示找回密码页面
public function index(){ public function index(){
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$this->display(); $this->display();
} }
//找回密码逻辑 //找回密码逻辑

View File

@@ -13,6 +13,9 @@ class GiftController extends BaseController{
public function index(){ public function index(){
$gift = M('links')->select(); $gift = M('links')->select();
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$this->assign('gift',$gift); $this->assign('gift',$gift);
$this->display(); $this->display();
} }
@@ -23,6 +26,9 @@ class GiftController extends BaseController{
$id = session('userId'); $id = session('userId');
$gid = I('get.gid',0,'intval'); $gid = I('get.gid',0,'intval');
if (!IS_POST) { if (!IS_POST) {
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$info = M('info')->where('user_id='.$id)->select(); $info = M('info')->where('user_id='.$id)->select();
$gift = M('links')->where('id='.$gid)->select(); $gift = M('links')->where('id='.$gid)->select();
$this->assign('info',$info); $this->assign('info',$info);

View File

@@ -13,7 +13,10 @@ class InfoController extends BaseController{
public function index(){ public function index(){
$id = session('userId'); $id = session('userId');
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$info = M('info')->where('user_id='.$id)->select(); $info = M('info')->where('user_id='.$id)->select();
$this->assign('title', $title);
$this->assign('info',$info); $this->assign('info',$info);
$this->display(); $this->display();
} }

View File

@@ -32,6 +32,9 @@ class PostController extends BaseController
$Page = new \Extend\Page($count,15);// 实例化分页类 传入总记录数和每页显示的记录数(15) $Page = new \Extend\Page($count,15);// 实例化分页类 传入总记录数和每页显示的记录数(15)
$show = $Page->show();// 分页显示输出 $show = $Page->show();// 分页显示输出
$post = $model->limit($Page->firstRow.','.$Page->listRows)->where($where)->order('post.id DESC')->where('user_id='.$id)->select(); $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('model', $post);
$this->assign('page',$show); $this->assign('page',$show);
$this->display(); $this->display();
@@ -43,6 +46,9 @@ class PostController extends BaseController
{ {
//默认显示添加表单 //默认显示添加表单
if (!IS_POST) { if (!IS_POST) {
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$this->assign("category",getSortedCategory(M('category')->select())); $this->assign("category",getSortedCategory(M('category')->select()));
$this->display(); $this->display();
} }
@@ -73,6 +79,9 @@ class PostController extends BaseController
$rid = I('get.rid',0,'intval'); $rid = I('get.rid',0,'intval');
$model = M("Post"); $model = M("Post");
$post = $model->where('user_id='.$id)->where('id='.$rid)->find(); $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->assign('model', $post);
$this->display(); $this->display();
} }

View File

@@ -20,6 +20,9 @@ class RegController extends Controller{
*/ */
public function index() public function index()
{ {
$tmodel= M('setting');
$title = $tmodel->where('id=1')->select();
$this->assign('title', $title);
$this->display(); $this->display();
} }

View File

@@ -36,7 +36,7 @@
<foreach name="info" item="v"> <foreach name="info" item="v">
<input type="text" name="alipay" class="form-control" style="width:50%" value="{$v.alipay}"> <input type="text" name="alipay" class="form-control" style="width:50%" value="{$v.alipay}">
</foreach> </foreach>
<div class="form-group"> <div class="form-group">
<label>礼品名称:</label> <label>礼品名称:</label>
<foreach name="gift" item="g"> <foreach name="gift" item="g">
<input type="text" name="gid" class="form-control" style="width:50%" value="{$g.title}"> <input type="text" name="gid" class="form-control" style="width:50%" value="{$g.title}">