问题:
dedecms5.6问答模块开启审核后,
推荐均不起作用,虽然点击后会出现推荐成功或者审核成功的字样
但依然是未审核状态,看askadmin.php中的语句,应该是点击审核后,修改数据库对应项-1为0
但是通过后台点审核后数据库对应状态依然是-1,没有变,只有数据库手动更改其为0才会审核通过
附askadmin.php对应审核动作代码
foreach($qstrs as $aid)
{
$aid = ereg_replace("[^0-9]","",$aid);
if($aid=="")
{
continue;
}
$dsql->SetQuery("Update `#@__ask` set status='0' where id='$aid' and status=-1 ");
$dsql->ExecuteNoneQuery();
}
ShowMsg("问题审核成功!",'ask_admin.php');
exit();
解答:
问题解决办法:
在 /后台管理目录/ask_admin.php 里面,
找到
$dsql->SetQuery("Update `#@__ask` set status='0' where id='$aid' and status=-1 ");
$dsql->ExecuteNoneQuery();
修改为:$dsql->ExecuteNoneQuery("Update `#@__ask` set status='0' where id='$aid' and status=-1 ");
上次我写到这里,以上解决方法是针对utf版本的。一下放出gbk 版本的:
打开 /include/dedesql.class.php
查找(169-174行):
if(!empty($sql))
{
$this->SetQuery($sql);
}else{
return false;
}
替换为:
if(!empty($sql))
{
$this->SetQuery($sql);
}
转载于:https://blog.51cto.com/scottlinn/392995