Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 5 尝试获取非对象的属性-laravel-elasticsearch_Laravel 5 - Fatal编程技术网

Laravel 5 尝试获取非对象的属性-laravel-elasticsearch

Laravel 5 尝试获取非对象的属性-laravel-elasticsearch,laravel-5,Laravel 5,正在尝试获取非对象的属性(视图:C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)(视图:C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php) 请帮帮我 $query = Input::get('query', false); $brans = request()->priceFilter; if(!empty($bran

正在尝试获取非对象的属性(视图:C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)(视图:C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)

请帮帮我

 $query = Input::get('query', false);
   $brans = request()->priceFilter;
    if(!empty($brans)):

        $product = "";
         foreach($brans  as $data){
           $minMax = explode("-",$data);

          $client = ClientBuilder::create()->build();
          $product[] = $client->search([
            "index"=> "my_custom_aficaa",
            "body"=>[
                "query"=>[
                        "bool"=>[
                            "must"=>[
                                "query_string"=>[
                                    "query"=> "casablanca"
                                ] ],
                                "filter" => [
                                "bool"=>[
                                        "should"=>[
                                     ["range"=> ["minrate"=>["gte"=> $minMax[0],"lte"=>$minMax[1]]]],

                                        ]
                                    ]
                                ]
                        ]
                    ],
                    "from" => 0,
                    "size"=>10000
            ]
            ]);


    }

    $books = $product[0];
    for($i=1;$i<count($product);$i++){
        $books= $product[$i]
                ->paginate(25);

    }
    if ($request->ajax())
    {
            return view('presult', compact('books'));
    }
   return view("welcome")->with('books',$books);
   else:
    $books = Afica::search()
        ->paginate(26);
 return view("welcome")->with('books',$books);



 endif;
$query=Input::get('query',false);
$brans=request()->priceFilter;
如果(!empty($brans)):
$product=“”;
foreach($brans作为$data){
$minMax=分解(“-”,$data);
$client=ClientBuilder::create()->build();
$product[]=$client->search([
“索引”=>my_custom_Afica”,
“正文”=>[
“查询”=>[
“bool”=>[
“必须”=>[
“查询字符串”=>[
“查询”=>“卡萨布兰卡”
] ],
“过滤器”=>[
“bool”=>[
“应该”=>[
[“范围”=>[“最小速率”=>[“gte”=>$minMax[0],“lte”=>$minMax[1]]],
]
]
]
]
],
“从”=>0,
“大小”=>10000
]
]);
}
$books=$product[0];
对于($i=1;$ipaginate(25);
}
如果($request->ajax())
{
返回视图('presult',compact('books');
}
返回视图(“欢迎”)->带有('books',$books);
其他:
$books=Afica::search()
->分页(26);
返回视图(“欢迎”)->带有('books',$books);
endif;
他认为:

  @foreach($books as $Afica)

        <article class="one-third">
          <figure><a href="#" title=""><img src="{{{ $Afica->photo_url }}}" alt="" style="height: 215px!important;" /></a></figure>

          <div class="details">

            <h3>{{{ $Afica->name }}}
              <span class="stars">

                  <?php 

                  for ($i=1 ; $i<=$Afica->class ; $i++) 
                  {
                  echo ' <i class="material-icons">&#xE838;</i>';
                  }

              ?>
              </span>
            </h3>
            <span class="address">{{{ $Afica->city_hotel }}},{{{ $Afica->address }}}  <a href="">Show on map</a></span>
            <span class="rating">{{{ $Afica->preferred }}}</span>
            <span class="price">Max rate  <em>$ {{{ $Afica->maxrate }}}</em> </span>
            <span class="pricee">Min rate  <em>$ {{{ $Afica->minrate }}}</em> </span>
            <div class="description">
              <p>{{{ $Afica->desc_en }}}<a href="hotel?query={{{ $Afica->name }}}">More info</a></p>
            </div>   
            <a href="{{{ $Afica->hotel_url }}}" title="Book now" class="gradient-button">Book now</a>
          </div>
        </article><?php $myArray[] = $Afica->id;?>

        <!--//deal-->
        @endforeach
@foreach($Afica)
{{{$Afica->name}}
{{{$Afica->city_hotel}},{{{{{$Afica->address}}
{{{$Afica->首选}}
最大速率${{$Afica->maxrate}}
最小速率${{$Afica->minrate}}
{{{$Afica->desc_en}}

@endforeach
up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up。。。。。。。。。。。。。