public function run() { if ($this->tids) { Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); $service2 = new PwDeleteTopic(new PwFetchTopicByTid($this->tids), $this->srv->user); $service2->setRecycle(true)->setIsDeductCredit($this->isDeductCredit)->setReason($this->_reason)->execute(); Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'delete', $this->srv->getData(), $this->_reason); } }
public function run($ids) { $srv = new PwDeleteTopic(new PwFetchTopicByFid($ids), $this->srv->user); $srv->setRecycle(false)->execute(); }
public function deletethreadAction() { list($tids, $isDeductCredit) = $this->getInput(array('tids', 'isDeductCredit')); if (!is_array($tids) || !count($tids)) { $this->showError('operate.select'); } $service = new PwDeleteTopic(new PwFetchTopicByTid($tids), new PwUserBo($this->loginUser->uid)); $service->setRecycle(true)->setIsDeductCredit((bool) $isDeductCredit)->execute(); $this->showMessage('operate.success'); }
/** * 删除帖子 * * @param array $param * @return boolean */ private function _delThreads() { Wind::import('SRV:forum.srv.operation.PwDeleteTopic'); $right = $this->getRight(); $banUids = array_keys($this->getBanUsers()); //【用户禁止帖子删除】 //删除当前主题帖子 当禁止非楼主时,不能删除当前主题 if (1 == $this->delete['current'] && 1 === $right['delCurrentThread'] && !array_diff($banUids, $this->threadCreatedUids)) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByTid'); //【用户禁止帖子删除】-根据帖子ID列表删除帖子到回收站 $service = new PwDeleteTopic(new PwFetchTopicByTid($this->tids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } if (1 == $this->delete['site'] && 1 === $right['delSiteThread']) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByUid'); //【用户禁止帖子删除】-并且按照用户ID列表删除帖子到回收站 $service = new PwDeleteTopic(new PwFetchTopicByUid($banUids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } elseif (1 == $this->delete['forum'] && 1 === $right['delForumThread']) { Wind::import('SRV:forum.srv.dataSource.PwFetchTopicByFidAndUids'); //【用户禁止帖子删除】-并且按照用户ID列表+版块ID删除帖子到回收站 foreach ($this->srv->getFids() as $fid) { $service = new PwDeleteTopic(new PwFetchTopicByFidAndUids($fid, $banUids), $this->loginUser); $service->setRecycle(true)->setIsDeductCredit(true)->execute(); } } return true; }