public function buildDm($type_id) { $result = $this->_getWindid()->getMessageById($type_id); if (!$result) { return false; } $dm = new PwReportDm(); $dm->setContent($result['content'])->setAuthorUserid($result['from_uid']); return $dm; }
/** * 标记处理 * * @return void */ public function dealCheckAction() { $id = $this->getInput('id'); !is_array($id) && ($id = array($id)); $dm = new PwReportDm(); $dm->setOperateUserid($this->loginUser->uid)->setOperateTime(Pw::getTime())->setIfcheck(1); $this->_getReportDs()->batchUpdateReport($id, $dm); $this->_sendDealNotice($id, '处理'); $this->showMessage('success'); }
/** * 批量更新 * * @param array $ids * @param PwReportDm $dm * @return bool */ public function batchUpdateReport($ids, PwReportDm $dm) { if (!is_array($ids) || !count($ids)) { return false; } if (($result = $dm->beforeUpdate()) !== true) { return $result; } return $this->_getDao()->batchUpdate($ids, $dm->getData()); }
public function buildDm($type_id) { $photo = $this->_service()->getPhotoInfo($type_id); if (!$photo) { return false; } $content = "照片({$photo['name']})"; $url = WindUrlHelper::createUrl('album/space/view', array('photoid' => $type_id, 'uid' => $photo['created_uid'])); $dm = new PwReportDm(); $dm->setAuthorUserid($photo['created_uid'])->setContent($content)->setContentUrl($url); return $dm; }
public function buildDm($type_id) { $threadDs = Wekit::load('forum.PwThread'); $result = $threadDs->getThread($type_id); if (!$result) { return false; } $content = Pw::substrs($result['subject'], 20); $hrefUrl = WindUrlHelper::createUrl('bbs/read/run', array('tid' => $result['tid'], 'fid' => $result['fid'])); $this->fid = $result['fid']; $dm = new PwReportDm(); $dm->setContent($content)->setContentUrl($hrefUrl)->setAuthorUserid($result['created_userid']); return $dm; }