当前位置: 首页>>代码示例>>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;未经允许,请勿转载。