diff --git a/Application/Admin/Controller/GiftbagController.class.php b/Application/Admin/Controller/GiftbagController.class.php index c3e08ba35..c3e771dd8 100644 --- a/Application/Admin/Controller/GiftbagController.class.php +++ b/Application/Admin/Controller/GiftbagController.class.php @@ -135,6 +135,13 @@ class GiftbagController extends ThinkController { // var_dump($data);die(); if($data){ $data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']); + + $noviceList = explode(',', $data['novice']); + $noviceList = array_filter($noviceList, function ($value) { + return $value != ''; + }); + $data['novice'] = implode(',', $noviceList); + $data['server_name']=get_server_name($data['server_id']); $data['novice_num'] = count(explode(',',$data['novice'])); $Model->add($data); @@ -194,6 +201,13 @@ class GiftbagController extends ThinkController { if($data){ $data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']); + + $noviceList = explode(',', $data['novice']); + $noviceList = array_filter($noviceList, function ($value) { + return $value != ''; + }); + $data['novice'] = implode(',', $noviceList); + $data['novice_num'] = count(explode(',',$data['novice'])); $Model->save($data); addOperationLog(array(