Ejemplo n.º 1
0
 public function gdelete()
 {
     $public = array();
     $AgentID = $this->_POST['agentid'];
     $token = $this->_POST['_token'];
     $timemap = $this->_POST['timemap'];
     $public['AgentID'] = $AgentID;
     $public['timemap'] = $timemap;
     $AgentApiModule = new AgentApiModule();
     $AgentApiInfo = $AgentApiModule->GetOneInfoByForID($AgentID);
     if ($AgentID == '' || $token == '' || ($timemap = '' || empty($AgentApiInfo))) {
         die(jsonp(array('0', '数据提供错误'), 'JSONP'));
     }
     $type = $this->_POST['type'];
     $id = $this->_POST['pid'];
     $public['private'] = $AgentApiInfo['private'];
     $verify = $this->verify($public, $token);
     if ($verify && $id != '') {
         $CustProModule = new CustProModule();
         $where = "where CustomersProjectID={$id} and AgentID={$AgentID}";
         if ($CustProModule->DeleteInfoByWhere($where)) {
             die(jsonp(array('0', '删除成功'), 'JSONP'));
         } else {
             die(jsonp(array('1001', '数据提供错误'), 'JSONP'));
         }
     } else {
         die(jsonp(array('1001', '数据提供错误'), 'JSONP'));
     }
 }