diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 32a7609e..2293f243 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -21,7 +21,7 @@ class Admin_ReviewController extends Zend_Controller_Action function indexAction() { $sql = "select m.id,md.title,u.username,u.realname,m.status from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid order by m.id desc limit 10 "; $re = $this->db->query($sql); @@ -43,7 +43,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,u.username,u.realname,m.status from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where u.id='$userid'"; @@ -163,7 +163,7 @@ class Admin_ReviewController extends Zend_Controller_Action if(!empty($keyword)) { $sql = "select m.*,u.username,u.realname from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where m.status=1 and md.title like '%$keyword%' @@ -182,7 +182,7 @@ class Admin_ReviewController extends Zend_Controller_Action else { $sql = "select m.*,md.title,u.username,u.realname from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where m.status=1"; $re = $this->db->query($sql); @@ -219,7 +219,7 @@ class Admin_ReviewController extends Zend_Controller_Action { $sql = "select m.*,md.*,u.realname from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where m.id=$show "; @@ -275,7 +275,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,m.status,m.uuid from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid where m.status in (2,3,4) $searchjoin"; $rs = $this->db->query($sql); $rows = $rs->fetchAll(); @@ -516,9 +516,10 @@ class Admin_ReviewController extends Zend_Controller_Action * * return view */ - function addonAction(){ - - $uuid=$this->_request->getParam('uuid'); + function addonAction() + { + $uuid=$this->_request->getParam('uuid'); + $userid=Zend_Auth::getInstance()->getIdentity()->id; $sql = "select * from mdstatus where uuid='$uuid'"; $re = $this->db->query($sql); @@ -526,29 +527,25 @@ class Admin_ReviewController extends Zend_Controller_Action if(empty($row['id'])) { - $auth = Zend_Auth::getInstance(); - if($auth->hasIdentity()) - { - $user = $auth->getIdentity(); - $userid = $user->id; - $sql = "insert into mdstatus (uuid,userid,ts_scheduled,status) values ('$uuid','$userid','".date("Y-m-d H:i:s")."','0')"; - try{ - if($this->db->exec($sql)>0) - { - $this->messenger->addMessage('操作成功!该数据已放入评审'); - $this->_redirect("/admin/review/draft"); - } - }catch( Exception $e){ - $this->messenger->addMessage('操作失败:'.$e->getMessage()); + $sql = "insert into mdstatus (uuid,userid,status) values ('$uuid','$userid','0')"; + try{ + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('操作成功!该数据已放入评审'); $this->_redirect("/admin/review/draft"); } + }catch( Exception $e){ + $this->messenger->addMessage('操作失败:'.$e->getMessage()); + $this->_redirect("/admin/review/draft"); } - - } - else - { - $this->messenger->addMessage('该数据已放入评审'); - $this->_redirect("/admin/data/md"); + } else if ($row['status']==5){ + $sql="update mdstatus set status=1 where status=5 and id=".$row['id']; + $this->db->query($sql); + $this->messenger->addMessage('操作成功!该数据已重新放入评审'); + $this->_redirect("/admin/review/accept"); + } else { + $this->messenger->addMessage('该数据已放入评审'); + $this->_redirect("/admin/data/md"); } }//将数据放入评审 @@ -584,7 +581,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.uuid,md.title,u.username,u.realname,m.status from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where m.status in (0,1,2,3,4) and u.id='$userid' $searchjoin order by m.status desc"; @@ -765,7 +762,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_created from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where status=0 $searchjoin"; @@ -826,7 +823,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where status=-1 $searchjoin"; @@ -866,7 +863,7 @@ class Admin_ReviewController extends Zend_Controller_Action } $sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_finished from mdstatus m - left join metadata md on md.uuid=m.uuid + right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid where status=5 $searchjoin";