0
我有這個搜索functionanlity在我的網頁之一,當用戶點擊搜索它會去一個控制器,它會根據用戶輸入搜索表,然後我會將其恢復到上一頁,但應該顯示的記錄已經基於搜索。什麼到目前爲止,我所做的是搜索功能,它已經在這裏工作是重定向回到上一頁數據搜索後laravel 4.2
public function tsearch()
{
$rnme = Input::get('rname');
$ath = Input::get('auth');
$fsze = Input::get('fsize');
$ftyp = Input::get('ftype');
$dc = Input::get('dcreate');
$du = Input::get('dupload');
$wld = Input::get('wldcrd');
$sbar = Input::get('searchb');
// dd($sbar);
// dd($sbar , $rnme , $ath , $fsze , $ftyp , $dc , $du, $wld);
$subcatid = Session::get('SCid');
$NSAdata = DB::table('nsa_fileuploads AS fu')
->join('nsa_systemusers AS nsu' , 'fu.sid' , '=' , 'nsu.sid')
->join('nsa_subcategory AS sc' , 'fu.subcategoryid' , '=' , 'sc.subcategoryid')
->join('nsa_maincategory AS mc' , 'sc.maincategoryid' , '=' , 'mc.maincategoryid')
->select('fu.fileid' , 'fu.filename' , 'fu.filesize' , 'fu.filetype',
'fu.thumbnail' , 'fu.confidential' , 'fu.sid', 'nsu.username',
'sc.subcategoryname', 'fu.updated_at' , 'fu.created_at', 'mc.maincategoryname' , 'sc.subcategoryid')
->where('fu.subcategoryid' , '=' , $subcatid);
$tick = "";
if($rnme == 'true')
{
$tick = $tick . " rname";
$NSAdata = $NSAdata->where('fu.filename' , 'LIKE' , '%'.$sbar.'%');
}
if($ath == 'true')
{
$tick = $tick . " auth";
$NSAdata = $NSAdata->where('nsu.username' , 'LIKE' , '%'.$sbar.'%');
}
if($fsze == 'true')
{
$tick = $tick . " fsze";
$NSAdata = $NSAdata->where('fu.filesize' , 'LIKE' , '%'.$sbar.'%');
}
if($ftyp == 'true')
{
$tick = $tick . " ftyp";
$NSAdata = $NSAdata->where('fu.filetype' , 'LIKE' , '%'.$sbar.'%');
}
if($dc == 'true')
{
$tick = $tick . " dc";
$NSAdata = $NSAdata->where('fu.created_at' , 'LIKE' , '%'.$sbar.'%');
}
if($du == 'true')
{
$tick = $tick . " du";
$NSAdata = $NSAdata->where('fu.updated_at' , 'LIKE' , '%'.$sbar.'%');
}
if($wld == 'true')
{
$tick = $tick . " wld";
$NSAdata = $NSAdata->where('fu.wildcard' , 'LIKE' , '%'.$sbar.'%');
}
$NSAdata = $NSAdata->get();
dd($NSAdata);
Redirect::back()->with('NSAdata' , $NSAdata);
}
我現在的問題是如何把它到目前爲止重定向到與我有搜索數據的前一頁我'使用這
Redirect::back()->with('NSAdata' , $NSAdata);
但它只是重定向到一個空白的白頁。關於如何做到這一點的任何想法?非常感謝!