通过数据库里的状态值改变模板上的css,为什么实现不了,求教tp高手看看

浏览:686 发布日期:2015/07/21 分类:求助交流
如图是审核中就显示字体图标为红色,已删除就显示字体图标为黑色。附上代码如下 if($info=M("handmebuyinfo")){
                    $row=$info->where("username='$username'")->select();
                    //dump($row[1][status]);
                    $this->assign('info', '求购');
                    }
                    
                    if($info=M("handsellinfo")){
                        $rows=$info->where("username='$username'")->select();
                        //dump($rows);
                        $this->assign('info1', '出售');
                    }                                                       
                    //$status = $info->where("username='$username'")->getField('status',true);
                    //dump($status[0]);
                    
                    if($row[0][status]=='审核中'){
                         $this->assign(color,'#DC143C');
                    }
                    elseif($row[0][status]=='显示中'){
                        $this->assign(color,'#006400');
                    }
                 
                   $this->assign('rows', $rows);
                   $this->assign('list', $row);
                     $this->display();
                 }
<b style="color:{$color}">{$vo.status}</b>
最佳答案
评论( 相关
后面还有条评论,点击查看>>