PHP code example of heqiubo / think-query-helper

1. Go to this page and download the library: Download heqiubo/think-query-helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

heqiubo / think-query-helper example snippets



$data = (new Book())
    ->queryHelper(function (QueryHelper $helper) {
         // 从请求参数中获取name值,并从数据库中查询
         $helper->where('name');
    })
    ->select();
    

where($field);          //指定AND查询条件
whereOr($field);        //指定OR查询条件
whereLike($field);      //指定Like查询条件
whereLikeOr($field);    //指定Like查询条件或
whereRange($field);     //范围查询
whereTime($field);      //时间查询
whereTimeRange($field); //查询当前时间在两个时间字段范围