<?php

namespace app\home\controller;


class Showhelp extends BaseMall
{
    public function _initialize()
    {
        parent::_initialize(); // TODO: Change the autogenerated stub
    }

    /**
     * 店铺帮助页
     *
     */
    public function index()
    {
        $model_help = Model('help');
        $list = $model_help->getShowStoreHelpList();
        $type_id = intval(input('param.t_id'));//帮助类型编号
        if ($type_id < 1 || empty($list[$type_id])) {
            $type_array = current($list);
            $type_id = $type_array['type_id'];
        }
        $this->assign('type_id', $type_id);
        $help_id = intval(input('param.help_id'));//帮助编号

        if ($help_id < 1 || empty($list[$type_id]['help_list'][$help_id])) {
            $help_array = @current($list[$type_id]['help_list']);
            $help_id = $help_array['help_id'];
        }
        $this->assign('help_id', $help_id);
        $help = $list[$type_id]['help_list'][$help_id];
        $this->assign('list', $list);//左侧帮助类型及帮助
        $this->assign('help', $help);//当前帮助
        $this->assign('article_list', '');//底部不显示首页的文章分类
        $phone_array = explode(',', config('site_phone'));
        $this->assign('phone_array', $phone_array);
        $this->assign('html_title', config('site_name') . ' - ' . '商家帮助指南');
        return $this->fetch($this->template_dir.'store_help');
    }
}