From ebfb8d580eb913e6a2ea8df15293b95808e215a6 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 10 Sep 2020 20:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=88=86=E7=B1=BB=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=AD=98=E5=88=B0SSDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Forms/CategoryTieForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Admin/Forms/CategoryTieForm.php b/app/Admin/Forms/CategoryTieForm.php index adecb33..ca78341 100644 --- a/app/Admin/Forms/CategoryTieForm.php +++ b/app/Admin/Forms/CategoryTieForm.php @@ -26,18 +26,21 @@ class CategoryTieForm extends Form $data = []; if(!empty($category)){ foreach ($category as $key => $value){ - $data[$value->sort] = json_encode([ + $data[$value->sort] = [ 'icon' => $value->cover_img, 'name' => $value->title, 'sort' => $value->sort, 'id' => $value->id - ]); + ]; } if(count($data) > 0){ // 根据sort排序 krsort($data); $save = array_column($data,null,'id'); + foreach($save as &$cate){ + $cate = json_encode($cate); + } $this->ssdb->client()->hclear('applet_index_category');