diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 48536104..7d55b3f2 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -858,8 +858,11 @@ class DataController extends Zend_Controller_Action foreach($paginator as $c) { //$author=$this->view->escape($c['author']); - $sql = "SELECT cr.id,cr.content as body,cr.reply,u.username,cr.ts_created FROM comments cr - LEFT JOIN users u ON cr.userid=u.id WHERE cr.reply=?"; + $sql = "SELECT cr.id,cr.content as body,cr.reply,u.username,cr.ts_created,u.usertype, + (SELECT au.uuid FROM mdauthor au WHERE au.userid=u.id AND au.uuid='$uuid') as uuid + FROM comments cr + LEFT JOIN users u ON cr.userid=u.id + WHERE cr.reply=?"; $sth = $this->db->prepare($sql); $sth->execute(array($c['id'])); $replys = $sth->fetchAll(); @@ -868,8 +871,25 @@ class DataController extends Zend_Controller_Action { foreach($replys as $v) { + $usertype = ""; + $color = ""; + if($v['usertype'] == "administrator") + { + $usertype = "[管理员]"; + $color="#009d00"; + } + if($v['uuid'] == $uuid) + { + $usertype = "[数据作者]"; + $color="#add2e9"; + } + if(!empty($color)) + { + $color = 'background:'.$color.';color:#FFFFFF;'; + } $replyhtml .= " -
".($v['body'])."