Пример #1
0
 protected function run()
 {
     Wind::import('SRV:forum.dm.PwTopicDm');
     $dm = new PwTopicDm(true);
     $dm->setDisabled(0);
     Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN);
     foreach ($this->fids as $fid => $value) {
         Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, $value, 0, $value);
     }
     return true;
 }
 public function run($ids)
 {
     Wind::import('SRV:forum.dm.PwTopicDm');
     $dm = new PwTopicDm();
     $dm->setDisabled(2)->setTopped(0)->setDigest(0);
     Wekit::load('forum.PwThread')->batchUpdateThread($ids, $dm);
     Wind::import('SRV:forum.dm.PwReplyDm');
     $dm = new PwReplyDm();
     $dm->setDisabled(2);
     Wekit::load('forum.PwThread')->batchUpdatePostByTid($ids, $dm);
     Wekit::load('recycle.PwTopicRecycle')->batchAdd($this->record);
 }
Пример #3
0
 private function deleteThread($topic)
 {
     $tid = $topic['tid'];
     $fid = $topic['fid'];
     $subject = $topic['subject'];
     $created_userid = $topic['created_userid'];
     $dm = new PwTopicRecycleDm();
     $dm->setTid($tid)->setFid($fid)->setOperateTime(time())->setOperateUsername('system')->setReason('长期断种');
     Wekit::load('recycle.PwTopicRecycle')->add($dm);
     $dm = new PwTopicDm($tid);
     $dm->setDisabled(2)->setTopped(0)->setDigest(0);
     Wekit::load('forum.PwThread')->updateThread($dm);
     $api = WindidApi::api('message');
     $api->send($created_userid, '您的种子 ' . $subject . ' 因长期断种已被系统自动移入回收站,如有异议请尽快联系管理员,管理员将根据相关规定决定恢复或彻底删除。', 1);
 }
Пример #4
0
 public function doPassThreadAction()
 {
     $tid = $this->getInput('tid');
     if (empty($tid)) {
         $this->showError('operate.select');
     }
     !is_array($tid) && ($tid = array($tid));
     $fids = array();
     $threaddb = Wekit::load('forum.PwThread')->fetchThread($tid);
     foreach ($threaddb as $key => $value) {
         $fids[$value['fid']]++;
     }
     Wind::import('SRV:forum.dm.PwTopicDm');
     $dm = new PwTopicDm(true);
     $dm->setDisabled(0);
     Wekit::load('forum.PwThread')->batchUpdateThread($tid, $dm, PwThread::FETCH_MAIN);
     foreach ($fids as $fid => $value) {
         Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, $value, 0, $value);
     }
     $this->showMessage('success');
 }