<?php
/* 快捷商城系统
 * 版本号：2.0
 * 官网：http://www.kjcms.cn
 * 2015-02-16
 */
 class ctl_weixin_message extends mod_weixin_message {

	//默认浏览页
	function act_default() {
		$group = (int)fun_get::get("url_type");
		if($group == 1) {
			$message = tab_weixin_message::get_remsg();
			$this->get_id = $message['message_id'];
		} else {
			$message = tab_weixin_message::get_guanzhu();
			$this->get_id = $message['message_id'];
			$group = 0;
		}
		if(isset($message['message_text'])) $message['message_text'] = tab_weixin_message::format_text($message['message_text'] , 1);
		$message['message_text_html'] = fun_get::filter($message['message_text'],true);
		$this->message = $message;
		$this->group = $group;
		return $this->get_view(); //显示页面
	}
	//关键词
	function act_keywords() {
		$this->nowdate = date("m月d日");
		$arr = tab_weixin_message::get_rekeywords('');
		$arr_list = array();
		foreach($arr as $item) {
			$item['message_text'] = fun_get::filter(tab_weixin_message::format_text($item['message_text'] , 1),true);
			$arr_list[] = $item;
		}
		$this->arr_list = $arr_list;
		return $this->get_view(); //显示页面
	}
	function act_keywords_edit() {
		$this->editinfo = $this->get_editinfo( fun_get::get('id') );
		return $this->get_view(); //显示页面
	}
	//保存
	function act_save() {
		$arr_return = $this->on_save();
		return fun_format::json($arr_return);
	}
	//保存关键词
	function act_keywords_save() {
		if( !$this->this_limit->chk_act('save') ) {
			cls_error::on_error("no_limit");
		}
		$arr_return = $this->on_keywords_save();
		return fun_format::json($arr_return);
	}
	//彻底删除,返回josn数据
	function act_delete() {
		$arr_return = $this->on_delete();
		return fun_format::json($arr_return);
	}

}