fengdangxing/yii2-elasticsearch-sql

There is no license information available for the latest version (v1.1.0) of this package.

yii2-elasticsearch-sql

v1.1.0 2021-09-09 04:59 UTC

This package is auto-updated.

Last update: 2021-10-09 08:39:37 UTC


README

链式查询es 建立es模型继承YiiElasticsearchSql 基类即可

#效果
$merge = new Orders();
 $query = $merge
            ->andWhere(['TransportName' => '万邦-欧洲速邮专线平邮-带电'])
            ->andWhere(['shop_id' => 42])
            ->andWhere(['OrderCode' => 2019122316119958820])
            ->notWhere(['shop_id' => 42])
            ->betweenWhere('AddTime', '2019-12-23 16:11:00', '2019-12-23 16:11:40')
            ->likeWhere('TransportName', '%云途% AND %云途% NOT %标快% NOT %标快% NOT %标快% NOT %标快%')
            ->compareWhere('PayTime', 'gt', '2019-12-23 15:20:40')
            ->compareWhere('PayTime', 'lt', '2019-12-23 15:20:44')
            ->notInWhere('shop_id', [42, 41, 43])
            ->inWhere('shop_id', [42, 41, 43])
            ->sum('ProductVolume')
            ->min('ProductVolume')
            ->max('ProductVolume')
            ->avg('ProductVolume')
            ->setPage(0, 20)
            ->groupBy('OrderCode')
            ->orderBy('PayTime', 'asc')
            ->select();