/** * @param $contest_id * * @return array */ public static function member_of_contest($contest_id) { $filter = array('rightstr' => 'c' . $contest_id, 'defunct' => self::DEFUNCT_NO); $result = array(); foreach (Model_Privilege::find($filter, 0, 0) as $item) { array_push($result, $item->user_id); } return $result; }
/** * @param $user_id */ public function remove_member($user_id) { $filter = array('user_id' => $user_id, 'rightstr' => 'c' . $this->contest_id); $perm = Model_Privilege::find($filter); foreach ($perm as $item) { $item->defunct = 1; $item->destroy(); } }