<?php
/**
 *
 * ============================================================================
 * * 版权所有 蜘蛛出行 * *
 * 网站地址: http://www.zhizhuchuxing.com
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * Author By: 倪宗锋
 * PhpStorm EntranceTicketController.php
 * Create By 2017/3/20 16:13 $
 */


namespace shop\controllers\prod;

use common\Controller\ShopWebController;
use common\util\EntranceTicketService;
use common\util\Util;

class EntranceTicketController extends ShopWebController
{
    public $service = null;

    public function getService()
    {
        if ($this->service == null) {
            $this->service = new EntranceTicketService();
        }
        return $this->service;
    }

    /**
     * Des:门票销售页面初始化
     * Name: actionInitialize
     * @return string
     * @author 倪宗锋
     */
    public function actionInitialize()
    {
        $prod_cate_id = $this->_post('prod_cate_id', '');
        $result = $this->getService()->getInitialize($prod_cate_id);
        return json_encode($result);
    }

    /**
     * Des:获取产品价格列表
     * Name: actionGetProdArr
     * @return string
     * @author 倪宗锋
     */
    public function actionGetProdArr()
    {

        $params = [
            'prod_cate_id' => $this->_post('prod_cate_id', ''),
            'date' => $this->_post('date', '')
        ];
        $result = $this->getService()->getProdArrForDate($params);
        return json_encode($result);
    }
}