vantage/period-queries 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vantage/period-queries

Composer 安装命令:

composer require vantage/period-queries

包简介

Query by overlapping and intersecting periods in Laravel

README 文档

README

Adds overlaps and intersects macros to your Illuminate\Database\Query\Builder.

Period relations

Installation

Just composer require vantage/period-queries

Usage

<?php

use Illuminate\Database\Eloquent\Model;

class Event extends Model
{
    /**
     * The attributes that should be mutated to dates.
     */
    protected $dates = ['started_at', 'ended_at'];

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = ['started_at', 'ended_at'];
}
use Carbon\CarbonPeriod;

$period = CarbonPeriod::create('2019-01-01', '2019-01-31');

Event::overlaps($period);
$start = new DateTime(2019, 1, 1);
$end = new DateTime(2019, 1, 31);
$period = new DatePeriod($start, 'P1D', $end);

Event::intersects($period);

Advanced

Event::whereTitle($title)->orOverlaps($period);
Event::whereTitle($title)->orIntersects($period);
Event::overlaps($period, ['created_at', 'updated_at']);

Contributing

  1. composer install
  2. ./vendor/bin/phpunit

统计信息

  • 总下载量: 557
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固