public function run() { if ($this->pids) { Wind::import('SRV:forum.srv.operation.PwDeleteReply'); Wind::import('SRV:forum.srv.dataSource.PwFetchReplyByPid'); $service1 = new PwDeleteReply(new PwFetchReplyByPid($this->pids), $this->srv->user); $service1->setRecycle(true)->setIsDeductCredit($this->isDeductCredit)->setReason($this->_reason)->execute(); //删除帖子回复 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'delete', $service1->data, $this->_reason, '', true); } 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', $service2->data, $this->_reason); } }
/** * Enter description here ... * */ public function deletereplyAction() { list($pids, $isDeductCredit) = $this->getInput(array('pids', 'isDeductCredit')); if (!is_array($pids) || !count($pids)) { $this->showError('operate.select'); } $service = new PwDeleteReply(new PwFetchReplyByPid($pids), new PwUserBo($this->loginUser->uid)); $service->setRecycle(true)->setIsDeductCredit((bool) $isDeductCredit)->execute(); $this->showMessage('operate.success'); }