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

	//默认浏览页
	function act_default() {
		//分页列表
		$this->arr_list = $this->get_pagelist();
		$s_category_id = (int)fun_get::get("s_category_id");
		if(!empty($s_category_id)) {
			$arr = tab_mall_goods_category::get_path($s_category_id);
			$arr_name = array();
			foreach($arr as $item) {
				$arr_name[] = $item['name'];
			}
			$this->s_category_txt = implode("->" , $arr_name);
		} else {
			$this->s_category_txt = '';
		}
		$this->arr_goods_tj = tab_mall_goods::get_perms("tj");
		return $this->get_view(); //显示页面
	}
	//编辑 新增 页面 ,有id时为编辑
	function act_edit() {

		$this->editinfo = $this->get_editinfo( fun_get::get('id') );
		$this->detail_list = $this->get_detail_list( fun_get::get('id') );
		$this->parts_list = $this->get_parts_list( fun_get::get('id') );
		$this->arr_state = tab_mall_goods::get_perms("state");
		$this->vipinfo = fun_format::json(cls_mall::get_vip_list());
		$this->arr_pic = $this->get_pic_list( fun_get::get('id') );
		return $this->get_view();
	}

	//保存操作,返回josn数据
	function act_save() {
		$arr_return = $this->on_save();
		return fun_format::json($arr_return);
	}
	//彻底删除,返回josn数据
	function act_delete() {
		$arr_return = $this->on_delete();
		return fun_format::json($arr_return);
	}
	function act_tj() {
		$arr_return = $this->on_tj();
		return fun_format::json($arr_return);
	}
}