Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

110 linhas
3.0 KiB

  1. <?php
  2. /**
  3. * 巴士自由行控制器
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm FreeWalkerController.php
  13. * Create By 2017/7/8 15:30 $
  14. */
  15. namespace zzcx\controllers\home;
  16. use Yii;
  17. use common\util\Util;
  18. use yii\web\Controller;
  19. use zzcx\service\home\FreeWalker;
  20. class FreeWalkerController extends Controller
  21. {
  22. public $service = null;
  23. public function service()
  24. {
  25. if ($this->service == null) {
  26. $this->service = new FreeWalker();
  27. }
  28. return $this->service;
  29. }
  30. /**
  31. * Des:查询
  32. * Name: actionSearch
  33. * @return string
  34. * @author 倪宗锋
  35. */
  36. public function actionSearch()
  37. {
  38. $param = [
  39. 'prod_name' => htmlspecialchars(trim($this->_post('prod_name', ''))),//产品名称
  40. ];
  41. $getList = $this->service()->getSearch($param);
  42. return Util::returnJsSu('', $getList['data']);
  43. }
  44. /**
  45. * Des:销售页面初始化
  46. * Name: actionInitialize
  47. * @return string
  48. * @author 倪宗锋
  49. */
  50. public function actionInitialize()
  51. {
  52. $pro_cate_id = $this->_post('pro_cate_id', '');
  53. $result = $this->service()->getInitialize($pro_cate_id);
  54. return json_encode($result);
  55. }
  56. /**
  57. * Des:获取产品价格列表
  58. * Name: actionGetProdArr
  59. * @return string
  60. * @author 倪宗锋
  61. */
  62. public function actionGetProdArr()
  63. {
  64. $params = [
  65. 'prod_cate_id' => $this->_post('prod_cate_id', ''),
  66. 'date' => $this->_post('date', '')
  67. ];
  68. $result = $this->service()->getProdArrForDate($params);
  69. return json_encode($result);
  70. }
  71. /**
  72. * Des:获取价格
  73. * Name: actionGetPrice
  74. * @return string
  75. * @author 倪宗锋
  76. */
  77. public function actionGetPrice()
  78. {
  79. $params = [
  80. 'pro_cate_id' => $this->_post('pro_cate_id', ''),
  81. 'start_date' => $this->_post('start_date', ''),
  82. 'prod_arr' => json_decode(Yii::$app->request->post('prod_arr', ''), true)
  83. ];
  84. $result = $this->service()->getPrice($params);
  85. return json_encode($result);
  86. }
  87. /**
  88. * Function Description:获取自由行保险价格
  89. * Function Name: actionGetFreeWalkDays
  90. * @return string
  91. * @author 田玲菲
  92. */
  93. public function actionGetFreeWalkInsure(){
  94. $pro_cate_id = $this->_post('pro_cate_id', '');
  95. $run_date = $this->_post('run_date', '');
  96. $result = $this->service()->getTripDays($pro_cate_id,$run_date);
  97. return json_encode($result);
  98. }
  99. }