有人说留言版块的审核单选按钮无效,我测试了一下还真他妈无效的,无论你勾选需要审核还是不需要审核 提交给数据库的都是0,也就是不需要审核~@vip.qq.com>

既然知道问题 那愿意应该就出现在存储过程上面了 我们打开留言的set页面看下,有这么一段话来控制单选按钮的:

/public_html/wx/view/new/admin/liuyan/set.html


1
2
3
4
5
6
<div  class = "control-group" >
    < label  class = "control-label"  for = "title" >是否开放留言板</ label >
       <div  class = "controls"  style= "vertical-align: middle;padding-top: 5px;" >
              {$m->radio(array( '0' => '无需审核' , '1' => '需要审核' ), 'isroomlistpic' , 'style="margin-top:-2px;"' )}
                                     </div>
                                 </div>


上面这段代码中我们看到了一个字段 ‘isroomlistpic’ 然而这个字段我在数据库找了半天也没找到 只有个issh是不是issh来控制radio的呢 话不多说 来修改看看


1
2
3
4
5
6
<div  class = "control-group" >
                                    < label  class = "control-label"  for = "title" >是否开放留言板</ label >
                                    <div  class = "controls"  style= "vertical-align: middle;padding-top: 5px;" >
                                        {$m->radio(array( '0' => '无需审核' , '1' => '需要审核' ), 'issh' , 'style="margin-top:-2px;"' )}                                      
                                    </div>
                                </div>


当然了 sys里面的set.php也要做下对应的修改了
/public_html/wx/sys/compilations/admin/liuyan/set.php


1
2
3
4
5
6
<div  class = "control-group" >
       < label  class = "control-label"  for = "title" >是否开放留言板</ label >
               <div  class = "controls"  style= "vertical-align: middle;padding-top: 5px;" >
                       <?php echo $m->radio(array( '0' => '无需审核' , '1' => '需要审核' ), 'issh' , 'style="margin-top:-2px;"' ); ?>                                      
                                     </div>
                                 </div>


好了现在再试试看吧

额 补充一下 刚才发现这个方便只修复了用户后台 并没有修复手机端
好吧 我再找找看

修改/public_html/wx/controller/wly/ly.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//查询一级留言
$ly =  new  Model( 'liuyan' );
if ($ set ->issh){
     $mres = $ly->where(array( 'pid' => '0' , 'wid' =>$wid, 'isval' => '1' ))->order( 'id desc' )->list_all();
} else {
     $mres = $ly->where(array( 'pid' => '0' , 'wid' =>$wid))->order( 'id desc' )->list_all();
}
$lly =  new  Model( 'liuyan' );
if ($ set ->issh){
     $nres = $lly->where(array( 'pid@<>' => '0' , 'wid' =>$wid, 'isval' => '1' ))->order( 'id desc' )->map_array_allres( 'pid' );
} else {
     $nres = $lly->where(array( 'pid@<>' => '0' , 'wid' =>$wid))->order( 'id desc' )->map_array_allres( 'pid' );
}
} else {
     die();
}