| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
- /**
- * @package merchant
- * @Author: Qinii
- * @Date: 2020/5/27
- */
- namespace app\controller\api\movie;
- use app\common\repositories\movie\MovieRepository;
- use app\common\repositories\system\groupData\GroupDataRepository;
- use app\controller\merchant\user\User;
- use crmeb\basic\BaseController;
- use think\App;
- class Movie extends BaseController
- {
- /**
- * @var repository
- */
- protected $repository;
- protected $userInfo;
- private $source;
- private $merId;
- /**
- * StoreProduct constructor.
- * @param App $app
- * @param repository $repository
- */
- public function __construct(App $app, MovieRepository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- }
- /**
- * 获取城市列表
- *
- * @return mixed
- */
- public function getMovieCity()
- {
- [$page, $limit] = $this->getPage();
- $initial = $this->request->params(['initial']);
- $city_name = $this->request->params(['city_name']);
- return app('json')->success($this->repository->getMovieCity($page, $limit, $initial, $city_name));
- }
- /**
- * 获取城市分区列表
- *
- * @return mixed
- */
- public function getArea()
- {
- $city_sign = $this->request->params(['city_sign']);
- if (empty($city_sign)) return app('json')->fail('请选择城市');
- return app('json')->success($this->repository->getMovieArea($city_sign));
- }
- /**
- * 获取影院列表
- *
- * @return mixed
- */
- public function getCinema()
- {
- [$page, $limit] = $this->getPage();
- $city_sign = $this->request->params(['city_sign']);
- $area_sign = $this->request->params(['area_sign']);
- return app('json')->success($this->repository->getCinema($page, $limit, $city_sign, $area_sign));
- }
- /**
- * 获取影片列表
- *
- * @return mixed
- */
- public function getFilm()
- {
- [$page, $limit] = $this->getPage();
- $cinema_sign = $this->request->params(['cinema_sign']);
- $film_sign = $this->request->params(['film_sign']);
- return app('json')->success($this->repository->getFilm($page, $limit, $cinema_sign, $film_sign));
- }
- /**
- * 获取影院场次列表
- *
- * @return mixed
- */
- public function getCinemaSched()
- {
- $cinema_sign = $this->request->params(['cinema_sign']);
- if (empty($cinema_sign)) return app('json')->fail('请选择影院');
- $film_sign = $this->request->params(['film_sign']);
- if (empty($film_sign)) return app('json')->fail('请选择影片');
- return app('json')->success($this->repository->getCinemaSched($film_sign, $cinema_sign));
- }
- /**
- * 获取场次座位
- *
- * @return mixed
- */
- public function getSchedSeat()
- {
- $relation_id = $this->request->params(['relation_id']);
- if (empty($cinema_sign)) return app('json')->fail('请选择场次');
- $sched_sign = $this->request->params(['sched_sign']);
- if (empty($film_sign)) return app('json')->fail('请选择场次');
- return app('json')->success($this->repository->getSchedSeat($relation_id, $sched_sign));
- }
- }
|