<?php

namespace app\home\controller;
use think\Lang;

class FLeaalbum extends BaseFleaMember {

    /**
     * 	验证是否开启闲置功能
     */
    public function _initialize() {
        parent::_initialize(); // TODO: Change the autogenerated stub
        Lang::load(APP_PATH . 'home/lang/'.config('default_lang').'/memberstorealbum.lang.php');
    }

    /**
     * 闲置图片列表，发布闲置调用
     */
    public function pic_list() {
        /**
         * 实例化相册类
         */
        $flea_model = model('flea');
        /**
         * 图片列表
         */
        $param = array();
        $param['store_id'] = session('member_id');
        $param['item_id'] = input('goods_id');
        $pic_list = $flea_model->getFleauploadList($param, 12);
        $this->assign('pic_list', $pic_list);
        $this->assign('show_page', $flea_model->page_info->render());
        $this->view->engine->layout(false);
        if (input('item') == 'goods') {
            return $this->fetch($this->template_dir . 'store_flea_sample');
        } elseif (input('item') == 'des') {
            return $this->fetch($this->template_dir . 'store_flea_sample_des');
        }
    }

}
