public function __construct() { parent::__construct(); $this->uid = $this->getUid(); $this->feedModel = Feed_Model::instance(); $this->new_format = $this->input->get('new_format', 0); $this->friendModel = Friend_Model::instance(); $this->groupModel = Group_Model::instance(); $this->activityModel = Activity_Model::instance(); }
public function __construct() { parent::__construct(); $this->model = new Message_Model(); $this->message_type = null; $this->activityModel = Activity_Model::instance(); $this->friendModel = Friend_Model::instance(); $this->groupModel = Group_Model::instance(); $this->groupContactModel = Group_Contact_Model::instance(); $this->contactModel = Contact_Model::instance(); }
private function _add_feed_comment($activity, $old_apply_type, $apply_type, $uid) { $feedModel = new Feed_Model(); if ($apply_type == Kohana::config('activity.apply_type.join')) { $feedStatus = "参加"; $applyStatus = "参加"; } else { if ($apply_type == Kohana::config('activity.apply_type.interest')) { $feedStatus = "关注"; $applyStatus = "感兴趣"; } } if ($activity['gid'] != 0) { if ($apply_type != Kohana::config('activity.apply_type.not_join')) { $commentModel = new Comment_Model(); $content = "参与报名:" . $applyStatus; if ($activity['feed_id']) { $feed_id = $activity['feed_id']; $feedInfo = $feedModel->getFeedById($feed_id); if ($feedInfo) { $group_type = $feedInfo[$feed_id]['group_type']; $group_id = $feedInfo[$feed_id]['group_id']; $owner_uid = $feedInfo[$feed_id]['owner_uid']; if (!$group_type) { //好友 $friendModel = Friend_Model::instance(); $isFriend = $friendModel->check_isfriend($owner_uid, $uid); if ($isFriend) { $commentModel->saveComment($feed_id, $content, $owner_uid); } } else { if ($group_type == 1) { //群内 $groupModel = Group_Model::instance(); $grade = $groupModel->getMemberGrade($group_id, $uid); if ($grade > 0) { $commentModel->saveComment($feed_id, $content, $owner_uid); } } else { if ($group_type == 2) { //活动内 $activityModel = Activity_Model::instance(); $apply_type = $activityModel->getActivityApplyType($group_id, $uid); if ($apply_type > 0) { $commentModel->saveComment($feed_id, $content, $owner_uid); } } } } } } if ($activity['action_feed_id']) { $commentModel->saveComment($activity['action_feed_id'], $content, $activity['creator_id']); } } } if (!$old_apply_type && ($apply_type == Kohana::config('activity.apply_type.join') || $apply_type == Kohana::config('activity.apply_type.interest')) && $activity['is_allow_invite']) { $application = array('id' => floatval($activity['aid']), 'title' => '查看活动', 'url' => 'action/showblogbox/' . $activity['aid']); $feedModel->addFeed($uid, 7, $text = $feedStatus . '了活动:' . $activity['title'], $this->get_source(), $application, $at = array(), $images = array(), $sync = array(), $group_type = 0, $group_id = 0, $retweet_id = 0, $allow_rt = 0, $allow_comment = 1, $allow_praise = 1, $allow_del = 1, $allow_hide = 1); } }