| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\common\model\movie\cinema;
- use app\model\BaseModel;
- class CinemaSched extends BaseModel
- {
- protected $name = 'movie_cinema_sched';
- public static function tablePk(): ?string
- {
- return 'id';
- }
- /**
- * @param $model
- * @param array $where
- * @return CinemaSched
- */
- public function search($model = null, array $where = [])
- {
- $model = $model ?? new self();
- return $model->when(isset($where['film_sign']) && $where['film_sign'], function ($query) use ($where) {
- $query->where('film_sign', $where['film_sign']);
- })->when(isset($where['cinema_sign']) && $where['cinema_sign'], function ($query) use ($where) {
- $query->where('cinema_sign', $where['cinema_sign']);
- })->when(isset($where['show_date']) && $where['show_date'], function ($query) use ($where) {
- $query->where('show_date', $where['show_date']);
- })->when(isset($where['city']) && $where['city'], function ($query) use ($where) {
- $query->where('city', 'like', "%{$where['city']}%");
- });
- }
- }
|