你可以帮我解决一下吗? (Laravel 5.1,IIS)“内部服务器错误500”。
public function updateForClients(Request $request) {
Debugbar::disable();
if($request->has('sku_list') && $request->has('clients')) {
DB::disableQueryLog();
$sku_list = array_map('trim', explode('|', $request->get('sku_list')));
$clients = array_map('trim', explode('|', $request->get('clients')));
$text_color_date = Carbon::parse($request->get('text_color_date'));
$text_color = $request->get('color');
$sql = [];
$today = Carbon::now()->format('Y-m-d H:i:s');
foreach($clients as $client) {
$sql[$client] = "BEGIN TRANSACTION ";
$sql[$client] .= "DELETE FROM eltk.dbo.system_products_meta_client WHERE client_id = '" . $client . "' AND sku IN ('". implode("', '", $sku_list) ."') ";
foreach($sku_list as $sku) {
$sql[$client] .= "INSERT INTO eltk.dbo.system_products_meta_client VALUES ('" . $sku . "', '" . $client . "', '" . $text_color . "', '" . $text_color_date . "', '" . $today ."', '" . $today ."') ";
}
$sql[$client] .= "COMMIT TRANSACTION GO";
}
foreach($sql as $query) {
DB::statement($query);
}
return redirect()->route('product.index')->with('form_success', true)->with('form_message', 'Information saved successfully!');
}
return redirect()->back();
}