search.stub 533 B

123456789101112131415
  1. /**
  2. * 搜索
  3. * @param array $where
  4. * @return \crmeb\basic\BaseModel
  5. * @throws \ReflectionException
  6. * @date {%DATE%}
  7. */
  8. public function searchCrudModel(array $where = [], $field = ['*'], string $order = '', array $with = [])
  9. {
  10. return $this->getModel()->field($field)->when($order !== '', function ($query) use ($order) {
  11. $query->order($order);
  12. })->when($with, function ($query) use ($with) {
  13. $query->with($with);
  14. }){%CONTENT_SEARCH_PHP%}
  15. }