我有一个带有字段(标题,cat1,cat2,cat3,cat4,位置,城市,区域)的表格postad
现在我正在传递2个值category_id和位置搜索结果从帖子广告表。
这是我的代码//搜索类别,位置
public function scopeLocationSearch($query,$post_location,$category_id)
{
return $query->category($category_id)->location($post_location)->get();
}
类别和位置范围如下所示:
public function s
我有以下问题?当你在我们的平台上搜索foo时,你会得到一个空白页面的搜索结果。如果用户输入的搜索查询不在我们的平台上,并带有尖刻的小响应,如“对不起,我们的平台上没有foo's”,我想放一个搜索结果。
在控制器下的searchcontroller.php中,我有以下内容
<?php
class SearchController extends BaseController
{
public function getIndex()
{
$search = Request::get('q');
if (empty($search)) {
给定以下代码:
$objResellerList - DB::table('ResellerMaster as RM')
->leftJoin('StateMaster as SM','SM.id',RM.id_StateMaster')
->leftJoin('RegionMaster as REM','REM.id','=','RM.id_RegionMaster')
->leftJoin('DealerGroupMaster as
我正在使用Laravel5.5,我在Product.php型号中为我的产品创造了空间:
public function scopeApproved($query)
{
return $query->where('publish', 1);
}
从laravel网站上拿来的。
然后我有下面的代码来显示我的搜索结果。
public function search()
{
$search = request('search');
$searchType = request('searchType');
if (s