lotos2512/

array_search_model

通过数组搜索模型

安装: 21

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

v0.1 2018-04-19 07:55 UTC

This package is not auto-updated.

Last update: 2024-09-26 17:41:50 UTC


README

此库通过从数组中搜索数据

安装

安装此扩展的首选方式是通过 Composer

运行以下命令之一

php composer.phar require lotos2512/array_search_model dev-master

基本用法

    $data = ChildArraySearchModel::find()
      ->where(['in', 'array_field', array])
      ->where(['===', 'array_field_or_callback_with_result_can_be_array_or_array_value', equal_value])
      ->where(['regex', array_field_or_callback_with_result_can_be_array_or_array_value, equal_value|equal_value|equal_value])
      ->orderBy(callback_with_sort_function_result)
      ->limit(int_value)
      ->offset(int_value)
      ->indexBy('array_field')
      ->all();