当前位置: 首页>>代码示例>>PHP>>正文


PHP option::updateState方法代码示例

本文整理汇总了PHP中option::updateState方法的典型用法代码示例。如果您正苦于以下问题:PHP option::updateState方法的具体用法?PHP option::updateState怎么用?PHP option::updateState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在option的用法示例。


在下文中一共展示了option::updateState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

        $condition = array();
        if ($op == 'add') {
            $condition[$action] = 1;
        } elseif ($op == 'reduction') {
            $condition[$action] = 0;
        }
        $result = $this->topic->update($condition, $topic_id);
        $this->addItem($result);
        $this->output();
    }
    /**
	 * (删除|屏蔽)话题
	 */
    public function delete()
    {
        $topic_id = isset($this->input['topic_id']) ? intval($this->input['topic_id']) : -1;
        if ($topic_id < 0) {
            $this->errorOutput(PARAM_WRONG);
        }
        $topic_info = $this->topic->detail($topic_id, 1);
        if (!$topic_info) {
            $this->errorOutput(TEAM_NO_TOPIC);
        }
        $action = trim(urldecode($this->input['action']));
        if (empty($action)) {
            $action = 'drop';
        }
        $condition = array();
        if ($action == 'drop') {
            $condition['state'] = 0;
        } elseif ($action == 'hidden') {
            $condition['state'] = -1;
        }
        //删除话题回复
        $this->topic->update_reply($condition, '', $topic_id);
        //删除附件
        $this->topic->update_topic_material($topic_id, 0);
        //删除视频
        $this->topic->update_topic_video($topic_id, 0);
        //删除赞
        $option = new option();
        $favorData = array('source' => 'topic', 'action' => 'favor', 'source_id' => $topic_id, 'state' => 0);
        $option->updateState($favorData);
        //删除标签
        $mark = new mark();
        $markData = array('source' => 'topic', 'source_id' => $topic_id, 'state' => 0);
开发者ID:h3len,项目名称:Project,代码行数:46,代码来源:topic_update.php

示例2: setTopicState

     //删除小组下的行动召集者
     $this->team->update_apply(array('status' => $state), '', $team_ids);
     //删除小组下的黑名单
     $this->team->update_blacklist(array('status' => $state), '', $team_ids);
     //删除申请的小组信息
     $this->team->update_team_apply(array('status' => $state), '', $team_ids);
     //删除小组下的话题
     $this->setTopicState($team_ids, $state);
     //删除小组下的行动
     $action = new activityCLass();
     $actionData = array('team_id' => $team_ids, 'type' => 'team', 'state' => $state);
     $action->updateDeleteState($actionData);
 }
 //逻辑删除还原话题数据
 private function setTopicState($team_ids, $state)
 {
     $topic_ids = $this->topic->get_topic_ids($team_ids, true);
     //获取未删除的话题数据
     if ($topic_ids) {
         //删除话题下的回复数据
         $rids = $this->topic->get_reply_ids($topic_ids);
         //获取未删除的回复数据
         if ($rids && is_array($rids)) {
             $this->topic->update_reply(array('state' => $state, 'type_state' => 'team'), implode(',', $rids));
         }
         //删除附件
         $this->topic->update_topic_material(array('state' => $state, 'type_state' => 'team'), '', $topic_ids);
         //删除视频
         $this->topic->update_topic_video(array('state' => $state, 'type_state' => 'team'), '', $topic_ids);
         //删除赞
         $option = new option();
         $favorData = array('source' => 'topic', 'action' => 'favor', 'source_id' => $topic_ids, 'state' => $state, 'type_state' => 'team');
         $option->updateState($favorData);
         //删除标签
开发者ID:h3len,项目名称:Project,代码行数:34,代码来源:team_update.php

示例3: array

			$materialData = array(
				'user_id' => $reply_info['poster_id'],
				'user_name' => $reply_info['poster_name'],
				'topic_id' => $reply_info['topic_id'],
				'team_id' => $topic_info['source_id'],
				'reply_id' => 0,
			);
			if(is_array($img_info) && !empty($img_info))
			{
				$materialNum = $this->topic->add_material($img_info, $materialData); //插入附件
				
				//更新话题下的附件个数
				$this->topic->update(array('material_num' => $materialNum), $reply_info['topic_id'], true);
			}
		}
		//视频修改
		if (isset($this->input['video_url']) && !$reply_info['reply_user_id'])
		{
			$video_url = trim(urldecode($this->input['video_url']));
			$video_info = $this->teamApi->show_video($reply_info['topic_id'], 'topic');
			if ($video_url != $video_info['url'])
			{
				$video->update_video($video_info['id'], $video_url, 'topic', $reply_info['topic_id']);
			}
		}
		//标签修改
		if (isset($this->input['topic_mark']) && !$reply_info['reply_user_id'])
		{
			$topic_mark = trim(urldecode($this->input['topic_mark']));
			include_once ROOT_PATH . 'lib/class/mark.class.php';
			$mark = new mark();
			$data = array(
				'source' => 'topic',
				'source_id' => $reply_info['topic_id'],
				'parent_id' => $topic_info['source_id'],
				'action' => 'topic_tag',
开发者ID:h3len,项目名称:Project,代码行数:36,代码来源:topic_update.php


注:本文中的option::updateState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。