Example #1
0
 /**
  * 忽略
  * 
  * @param array $notice
  */
 public function ignoreNotice($notice, $ignore = 1)
 {
     if (!$notice) {
         return false;
     }
     Wind::import('SRV:message.dm.PwMessageNoticesDm');
     $dm = new PwMessageNoticesDm();
     $dm->setIgnore($ignore);
     Wekit::load('message.PwMessageNotices')->batchUpdateNoticeByUidAndType($notice['uid'], $notice['typeid'], $dm);
     return Wekit::load('message.srv.PwNoticeService')->setIgnoreNotice($notice['typeid'], $notice['uid'], $ignore);
 }
Example #2
0
 /**
  * 
  * (忽略|取消忽略)一个通知
  */
 public function ignoreNotice($id, $ignore = 1)
 {
     $id = intval($id);
     $ignore = intval($ignore);
     $ignore = $ignore ? 1 : 0;
     $notice = $this->_getNoticesDs()->getNotice($id);
     if (!$notice) {
         return false;
     } else {
         Wind::import('SRV:message.dm.PwMessageNoticesDm');
         $dm = new PwMessageNoticesDm($id);
         $dm->setIgnore($ignore);
         $this->_getNoticesDs()->updateNotice($dm);
         //ingore to app
         $noticeAction = $this->_getActionByTypeid($notice['typeid']);
         if ($noticeAction && $noticeAction->ignoreNotice) {
             $noticeAction->ignoreNotice($notice, $ignore);
         }
         return true;
     }
 }