|
- <?php
- /**
- * 巴士自由行控制器
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 倪宗锋
- * PhpStorm FreeWalkerController.php
- * Create By 2017/7/8 15:30 $
- */
-
- namespace zzcx\controllers\home;
-
- use Yii;
- use common\util\Util;
- use yii\web\Controller;
- use zzcx\service\home\FreeWalker;
-
- class FreeWalkerController extends Controller
- {
- public $service = null;
-
- public function service()
- {
- if ($this->service == null) {
- $this->service = new FreeWalker();
- }
- return $this->service;
- }
-
- /**
- * Des:查询
- * Name: actionSearch
- * @return string
- * @author 倪宗锋
- */
- public function actionSearch()
- {
- $param = [
- 'prod_name' => htmlspecialchars(trim($this->_post('prod_name', ''))),//产品名称
- ];
- $getList = $this->service()->getSearch($param);
- return Util::returnJsSu('', $getList['data']);
- }
-
- /**
- * Des:销售页面初始化
- * Name: actionInitialize
- * @return string
- * @author 倪宗锋
- */
- public function actionInitialize()
- {
- $pro_cate_id = $this->_post('pro_cate_id', '');
- $result = $this->service()->getInitialize($pro_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->service()->getProdArrForDate($params);
- return json_encode($result);
- }
-
- /**
- * Des:获取价格
- * Name: actionGetPrice
- * @return string
- * @author 倪宗锋
- */
- public function actionGetPrice()
- {
- $params = [
- 'pro_cate_id' => $this->_post('pro_cate_id', ''),
- 'start_date' => $this->_post('start_date', ''),
- 'prod_arr' => json_decode(Yii::$app->request->post('prod_arr', ''), true)
- ];
- $result = $this->service()->getPrice($params);
- return json_encode($result);
- }
-
-
- /**
- * Function Description:获取自由行保险价格
- * Function Name: actionGetFreeWalkDays
- * @return string
- * @author 田玲菲
- */
- public function actionGetFreeWalkInsure(){
- $pro_cate_id = $this->_post('pro_cate_id', '');
- $run_date = $this->_post('run_date', '');
- $result = $this->service()->getTripDays($pro_cate_id,$run_date);
- return json_encode($result);
- }
-
- }
|