芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/tblonline.org/app/Http/Controllers/Select2Controller.php
array('company_id'=> 1), //general company Data '2' => array('company_id'=> 1, 'item_type'=> 'product'), //Item Type Product ); $table = $request->get('table'); $value = $request->get('value'); $display = $request->get('display'); $display2 = $request->get('display2'); $where = $request->get('where'); $q = $request->get('q'); $display_option = "$display as text"; if($display2 != ''){ $display_option = "CONCAT($display,' - ',$display2) AS text"; } if($where != ''){ $result = DB::table($table) ->select("$value as id", DB::raw($display_option)) ->where($display,'LIKE',"$q%") //->where($data_where[$where]) ->get(); }else{ $result = DB::table($table) ->select("$value as id", DB::raw($display_option)) ->where($display,'LIKE',"$q%") ->get(); } return $result; } }