當前位置: 首頁>>代碼示例>>PHP>>正文


PHP option::members方法代碼示例

本文整理匯總了PHP中option::members方法的典型用法代碼示例。如果您正苦於以下問題:PHP option::members方法的具體用法?PHP option::members怎麽用?PHP option::members使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在option的用法示例。


在下文中一共展示了option::members方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setting

        $this->output();
    }
    /**
	 * 設置小組信息操作
	 */
    public function setting()
    {
        $team_id = intval($this->input['team_id']);
        //檢測對應的小組是否存在
        $team_info = $this->team->detail($team_id, 1);
        if (!$team_info) {
            $this->errorOutput(TEAM_NO_EXISTS);
        }
        if ($team_info['creater_id'] != $this->user['user_id']) {
            $this->errorOutput(NO_PERMISSION);
        }
        $data = $this->filter_data();
        $verify_data = array();
        //檢測小組類型是否存在
        if (isset($data['team_type']) && $data['team_type']) {
            $result_type = $this->team->check_team_type($data['team_type']);
            if (!$result_type) {
                $this->errorOutput(PARAM_WRONG);
            }
            $verify_data['team_type'] = $data['team_type'];
        }
        if ($team_info['team_category'] != $data['team_category']) {
            //檢測小組分類是否存在
            $result_category = $this->team->check_team_category($data['team_category']);
            if (!$result_category) {
                $this->errorOutput(PARAM_WRONG);
            }
            $verify_data['team_category'] = $data['team_category'];
        }
        if ($team_info['team_name'] != $data['team_name']) {
            //檢測更新的小組名稱是否存在
            $result_name = $this->team->check_team_name($data['team_name'], $team_id);
            if ($result_name) {
                $this->errorOutput(TEAM_EXISTS);
            }
            $verify_data['team_name'] = $data['team_name'];
        }
        if ($team_info['introduction'] != $data['introduction']) {
            $verify_data['introduction'] = $data['introduction'];
        }
        if (isset($data['team_logo']) && $data['team_logo']) {
            $verify_data['team_logo'] = $data['team_logo'];
        }
        if (isset($data['notice'])) {
            if ($team_info['notice'] != $data['notice']) {
                $verify_data['notice'] = $data['notice'];
            }
        }
        $verify_data['update_time'] = TIMENOW;
        $result = $this->team->update($verify_data, $team_id);
        //標簽更新
        if ($team_info['tags'] != $data['tags']) {
            $team_mark = $data['tags'];
        }
        if (isset($team_mark) && $result) {
            $mark = new mark();
            $data = array('source' => 'team', 'source_id' => $team_id, 'parent_id' => $team_id, 'action' => 'team_tag', 'user_id' => $team_info['creater_id']);
            if ($team_mark) {
                $data['name'] = $team_mark;
            }
            $result_mark = $mark->update_source_id_mark($data);
            if ($result_mark) {
                $this->team->update(array('tags' => $team_mark), $team_id);
            } else {
                $this->errorOutput(FAIL_OP);
            }
        }
        if ($verify_data['notice'] && $result) {
            //獲取關注小組的用戶信息
            $option = new option();
            $member = $option->members('team', $team_id, 'attention', 0, -1);
            //發送通知
            $send_arr = array();
            if ($member['data']['attention']) {
                $send_con = array();
                foreach ($member['data']['attention']['infos'] as $v) {
                    $send_con['from_id'] = 0;
                    $send_con['to_id'] = $v['user_id'];
                    $send_con['content'] = '您關注的"' . $team_info['team_name'] . '小組"有新公告!';
                    $send_con['page_link'] = 'team.php?team_id=' . $team_id;
                    $send_con['link_text'] = '點擊查看';
                    $send_arr[] = $send_con;
                }
            }
            if ($send_arr) {
                $this->notify->notify_send(json_encode($send_arr), 0);
            }
        }
        //更新搜索
開發者ID:h3len,項目名稱:Project,代碼行數:94,代碼來源:team_update.php

示例2: trim

        if ($team_id < 0) {
            $this->errorOutput(PARAM_WRONG);
        }
        $team_info = $this->team->detail($team_id, 1);
        if (!$team_info['team_id']) {
            $this->errorOutput(PARAM_WRONG);
        }
        $user_ids = trim(urldecode($this->input['user_id']));
        $apply_users = $this->team->is_apply_user($team_id, $user_ids);
        if ($apply_users) {
            foreach ($apply_users as $v) {
                $this->addItem($v);
            }
        }
        $this->output();
    }
    /**
	 * 獲取關注小組的用戶
開發者ID:h3len,項目名稱:Project,代碼行數:18,代碼來源:team.php


注:本文中的option::members方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。