mitirrli/tp-query

This package is abandoned and no longer maintained. No replacement package was suggested.

model query for thinkphp.

1.1.0 2020-09-24 05:54 UTC

README

🌈 This package is deprecated, please use Mitirrli/build-query.

Build Status StyleCI build status Total Downloads Latest Stable Version Latest Unstable Version License

Environment

  • PHP >= 7.0

Installation

$ composer require "mitirrli/tp-query"

QuickStart

use Mitirrli\TpQuery\Constant\Search;

$this->param($params)
     ->initial(['initial' => 0]) //Set an initial value
     ->key('name', Search::PERCENT_RIGHT) //Right fuzzy search
     ->key('avatar') //Accurate search
     ->key('phone', Search::PERCENT_ALL) //All fuzzy search
     ->inKey('type') //Array search
     ->betweenKey('created_at', 'started_at', 'ended_at') //Between search
     ->beforeKey('id'), //Before Key
     ->afterKey('id'), //After kay
     ->renameKey('backend', 'frontend') //Rename param
     ->unsetKey('initial') //Unset param
     ->result(); //Get result