__itemfile = new ItemAtt(); } public function insertItemFileRecord($postArray) { $this->__itemfile->ownerid = $postArray['ownerid']; $this->__itemfile->pid = $postArray['pid']; $this->__itemfile->pmid = $postArray['pmid']; $this->__itemfile->filename = $postArray['filename']; $this->__itemfile->fileext = $postArray['fileext']; $this->__itemfile->filesize = $postArray['filesize']; $this->__itemfile->filepath = $postArray['filepath']; $this->__itemfile->intime = time(); if (isset($postArray['oldiaid'])) $this->__itemfile->oldiaid = $postArray['oldiaid']; return $this->__itemfile->insert(); } public function getItemFile($iaid) { return $iaid ? $this->__itemfile->getOne(array('where' => 'iaid=?', 'param' => array($iaid), 'asArray' => TRUE)) : FALSE; } public function getFilesAll($pmid) { return $pmid ? $this->__itemfile->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE)) : FALSE; } public function getFileHistory($oldiaid) { return $oldiaid ? $this->__itemfile->find(array('where' => 'oldiaid=?', 'param' => array($oldiaid), 'asArray' => TRUE)) : FALSE; } public function updateItemFields($id, $fname, $encode = 1) { if ($encode == 1) { $this->__itemfile->filename = iconv('GBK', 'UTF-8', $fname); } else { $this->__itemfile->filename = $fname; } return $this->__itemfile->update(array('where' => 'iaid=?', 'param' => array($id))); } public function delItem($iaid) { $this->__itemfile->delete(array('where' => 'iaid=?', 'param' => array($iaid))); } public function getGroupOwnerid($pmid) { return $pmid ? $this->__itemfile->find(array('where' => 'pmid=?', 'groupby' => 'ownerid', 'param' => array($pmid), 'asArray' => TRUE)) : FALSE; } } ?>