<?php
/**
 * 关注中心
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author lss <lss@qq.com>
 */
namespace Member\Controller;
use Think\Controller;
class CollectionController extends BaseController
{
    /**
     *商品收藏
     */
    public function collection_goods()
    {
        $collectgoods = D('Common/Member')->get_collect_goods();
        $this->assign($collectgoods);
        $this->assign('tplseo_title', '商品收藏_会员中心_' . C('WEB_SITE_TITLE'));
        $this->display();
    }

    /**
     *店铺收藏
     */
    public function collection_shop()
    {
        $collectshop = D('Common/Member')->get_collect_shops();
        $this->assign($collectshop);
        $this->assign('tplseo_title', '店铺收藏_会员中心_' . C('WEB_SITE_TITLE'));
        $this->display();
    }

    /**
     *删除收藏的商品或店铺
     * @param $id 收藏的商品或店铺ID
     * @param $type 删除的是商品还是店铺
     */
    public function delete_collect($id, $type)
    {
        $data = D('Common/Member')->delete_collect($id, $type);
        $this->ajaxReturn($data);
    }
}
?>