示例#1
0
 public static function execut_notice($foreign_table, $foreign_id, $type_key, $member_id_from, $notice_member_ids)
 {
     if (!$notice_member_ids) {
         return;
     }
     $obj_notice = Model_Notice::check_and_create($foreign_table, $foreign_id, Site_Util::get_notice_type($type_key));
     Model_NoticeMemberFrom::check_and_create($obj_notice->id, $member_id_from);
     foreach ($notice_member_ids as $notice_member_id) {
         Site_Util::update_notice_status2unread($notice_member_id, $obj_notice->id);
     }
 }
示例#2
0
文件: util.php 项目: uzura8/flockbird
 public static function change_status2read($member_id, $foreign_table, $foreign_id, $type_keys = null)
 {
     $reduce_num = 0;
     $notices = Model_Notice::get4foreign_data($foreign_table, $foreign_id, self::convert_type_keys2types($type_keys));
     foreach ($notices as $notice) {
         if (Model_NoticeStatus::change_status2read($member_id, $notice->id)) {
             $reduce_num++;
         }
     }
     $notices = Model_Notice::get4parent_data($foreign_table, $foreign_id);
     foreach ($notices as $notice) {
         if (Model_NoticeStatus::change_status2read($member_id, $notice->id)) {
             $reduce_num++;
         }
     }
     self::delete_unread_count_cache($member_id);
     return $reduce_num;
 }