westdc-zf1/application/models/data/Review.php

42 lines
933 B
PHP
Raw Normal View History

<?php
class Review extends Zend_Controller_Plugin_Abstract
{
private $db; //传入PDO对象.
private $auth = NULL; //Zend_Auth 对象
//使用到的公共变量
public $tbl_review = "mdexpertreview";
function __construct($db)
{
$this->db = $db;
}
//接受或者拒绝评审
function invite($id,$uuid,$uid,$status)
{
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
{
return"参数错误";
}
if($id != $uid)
{
return "您无权使用此通知";
}//非本人操作
try{
$sql = "update ".$this->tbl_review." set status=$status where id='$id' and uuid='$uuid'";
if($this->db->exec($sql))
{
return true;
}else{
return "您无权限进行此操作";
}
}catch(Exception $e){
return "处理中出现错误";
}
}
}