public function run() { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $replyDm = new PwReplyDm($this->pid); $replyDm->setTopped($this->topped); $this->_getThreadDs()->updatePost($replyDm); $topicDm = new PwTopicDm($this->tid); if ($this->topped) { $toppedDm = new PwPostsToppedDm(); $toppedDm->setPid($this->pid)->setTid($this->tid)->setCreatedUserid($this->srv->user->uid)->setFloor($this->lou); $this->_getPostsToppedDs()->addTopped($toppedDm); $topicDm->addReplyTopped(1); } else { $topicDm->addReplyTopped(-1); $this->_getPostsToppedDs()->deleteTopped($this->pid); } $this->_getThreadDs()->updateThread($topicDm, PwThread::FETCH_MAIN); if ($this->topped == 1) { $type = 'threadtopped'; } else { $type = 'untopped'; } Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, $type, $this->srv->getData(), $this->_reason, '', true); return true; }
public function run($ids) { Wekit::load('forum.PwPostsTopped')->batchDeleteTopped($this->record); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwTopicDm(true); $dm->addReplyTopped(-1); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); }