From 007b7b5c1fb39d9166c4f8da3008642aad1162ae Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 9 Jul 2020 18:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GiftbagController.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(