2016-09-13 69 views
0

我是Laravel和Yajra數據表的新手。我開發了一個Web應用程序(在Windows XAMPP中),並且一切正常,直到我最近將項目上載到共享主機(UNIX)中,數據表無法加載視圖並拋出錯誤消息。Laravel 5.3 - 在查詢生成器中缺少「值」屬性

該錯誤消息我得到的是:

ErrorException在Request.php線38: 未定義指數:值 在Request.php線38 在HandleExceptions->的HandleError( '8',「未定義index:value','/home/posgb/public_html/boatMain/vendor/yajra/laravel-datatables-oracle/src/Request.php','38',array())in Request.php line 38

我在我的機器和服務器上比較了我的查詢生成器輸出的DD結果,發現「值」attr ibute從「搜索」數組中缺失。

我的查詢:

$query = DB::table('item_subcat') 
       ->leftJoin('item_customized', 'item_subcat.subcatID', '=', 'item_customized.subcatID') 
       ->join('item_cat', 'item_subcat.itemCatID', '=', 'item_cat.itemCatID') 
       ->select(array('item_subcat.subcatID', 'item_subcat.itemCode', 'item_subcat.itemName', 'item_cat.itemCatName', 'item_customized.customize_name', DB::raw('IF(item_subcat.is_categorize = "0", item_subcat.itemPrice, item_customized.price) AS ITEMPRICE'), 'item_subcat.is_activate', 'item_customized.itemCustomID')); 
dd($query); 

DD的結果在我的電腦:

   #parameters: array:7 [ 
        "draw" => "1" 
        "columns" => array:7 [ 
        0 => array:5 [ …5] 
        1 => array:5 [ …5] 
        2 => array:5 [ …5] 
        3 => array:5 [ …5] 
        4 => array:5 [ …5] 
        5 => array:5 [ …5] 
        6 => array:5 [ …5] 
        ] 
        "order" => array:1 [ 
        0 => array:2 [ …2] 
        ] 
        "start" => "0" 
        "length" => "10" 
        "search" => array:2 [ 
        "value" => "" /*This is the missing value */ 
        "regex" => "false" 
        ] 
        "branch" => "ALL" 
       ] 
       } 

DD的結果在我的服務器:

+request: ParameterBag {#41 
       #parameters: array:7 [ 
        "draw" => "1" 
        "columns" => array:7 [ 
        0 => array:5 [ …5] 
        1 => array:5 [ …5] 
        2 => array:5 [ …5] 
        3 => array:5 [ …5] 
        4 => array:5 [ …5] 
        5 => array:5 [ …5] 
        6 => array:5 [ …5] 
        ] 
        "order" => array:1 [ 
        0 => array:2 [ …2] 
        ] 
        "start" => "0" 
        "length" => "10" 
        "search" => array:1 [ 
        "regex" => "false" 
        ] 
        "branch" => "ALL" 
       ] 
       } 

請可以告訴我在哪裏,應該我看着失蹤的「價值「在數組中,因爲它導致我無法生成數據表。 TYVM爲那些花時間去看這個。

回答

0

原因是由於我的服務器中的PHP.ini設置,默認情況下,GET和POST請求中不允許空值。