From 63688779348b087b29a288c4b87e912d4c077603 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 8 Sep 2022 15:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=B1=BB=E5=92=8C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database/seeders/CategoriesSeeder.php | 1081 ++++++++----------------- database/seeders/SettingsSeeder.php | 740 +---------------- 2 files changed, 332 insertions(+), 1489 deletions(-) diff --git a/database/seeders/CategoriesSeeder.php b/database/seeders/CategoriesSeeder.php index 97a73ebb..f388fc89 100644 --- a/database/seeders/CategoriesSeeder.php +++ b/database/seeders/CategoriesSeeder.php @@ -11,11 +11,10 @@ namespace Database\Seeders; -use Beike\Models\Brand; use Beike\Models\Category; -use Beike\Models\CategoryDescription; use Beike\Models\CategoryPath; use Illuminate\Database\Seeder; +use Beike\Models\CategoryDescription; class CategoriesSeeder extends Seeder { @@ -27,7 +26,6 @@ class CategoriesSeeder extends Seeder public function run() { $categories = $this->getCategories(); - if ($categories) { Category::query()->truncate(); foreach ($categories as $item) { @@ -50,139 +48,31 @@ class CategoriesSeeder extends Seeder CategoryPath::query()->create($item); } } - + // (new CategoryService())->repairCategories(0); } public function getCategories() { return [ - [ - "id" => 100000, - "parent_id" => 0, - "position" => 2, - "active" => 1, - ], - [ - "id" => 100001, - "parent_id" => 100000, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100002, - "parent_id" => 100001, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100003, - "parent_id" => 0, - "position" => 1, - "active" => 1, - ], - [ - "id" => 100004, - "parent_id" => 100008, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100005, - "parent_id" => 100004, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100006, - "parent_id" => 100005, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100007, - "parent_id" => 0, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100008, - "parent_id" => 0, - "position" => 9, - "active" => 1, - ], - [ - "id" => 100009, - "parent_id" => 100007, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100010, - "parent_id" => 0, - "position" => 0, - "active" => 0, - ], - [ - "id" => 100011, - "parent_id" => 0, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100012, - "parent_id" => 100011, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100013, - "parent_id" => 0, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100014, - "parent_id" => 100012, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100015, - "parent_id" => 100014, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100018, - "parent_id" => 100012, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100019, - "parent_id" => 100014, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100020, - "parent_id" => 100018, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100031, - "parent_id" => 100000, - "position" => 0, - "active" => 1, - ], - [ - "id" => 100035, - "parent_id" => 100011, - "position" => 0, - "active" => 1, - ] + ["id" => 100001, "parent_id" => 0, "position" => 2, "active" => 1], + ["id" => 100002, "parent_id" => 100001, "position" => 0, "active" => 1], + ["id" => 100003, "parent_id" => 0, "position" => 1, "active" => 1], + ["id" => 100004, "parent_id" => 100007, "position" => 0, "active" => 1], + ["id" => 100005, "parent_id" => 0, "position" => 0, "active" => 1], + ["id" => 100006, "parent_id" => 0, "position" => 0, "active" => 1], + ["id" => 100007, "parent_id" => 0, "position" => 9, "active" => 1], + ["id" => 100008, "parent_id" => 100006, "position" => 0, "active" => 1], + ["id" => 100009, "parent_id" => 0, "position" => 0, "active" => 0], + ["id" => 100010, "parent_id" => 0, "position" => 0, "active" => 1], + ["id" => 100011, "parent_id" => 100010, "position" => 0, "active" => 1], + ["id" => 100012, "parent_id" => 0, "position" => 0, "active" => 1], + ["id" => 100013, "parent_id" => 100010, "position" => 0, "active" => 1], + ["id" => 100014, "parent_id" => 100010, "position" => 0, "active" => 1], + ["id" => 100015, "parent_id" => 100013, "position" => 0, "active" => 1], + ["id" => 100016, "parent_id" => 100014, "position" => 0, "active" => 1], + ["id" => 100017, "parent_id" => 100018, "position" => 0, "active" => 1], + ["id" => 100018, "parent_id" => 0, "position" => 0, "active" => 1] ]; } @@ -190,394 +80,324 @@ class CategoriesSeeder extends Seeder { return [ [ - "id" => 11, - "category_id" => 100005, - "locale" => "zh_cn", - "name" => "2-1-1", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 12, - "category_id" => 100005, - "locale" => "en", - "name" => "2-1-1", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 13, - "category_id" => 100006, - "locale" => "zh_cn", - "name" => "特价购买", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 16, + "id" => 1, "category_id" => 100002, "locale" => "zh_cn", "name" => "平板耳机", "content" => "", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" ], [ - "id" => 17, + "id" => 2, "category_id" => 100002, "locale" => "en", - "name" => "平板耳机", - "content" => "", + "name" => "Pad", + "content" => "Pad", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" ], [ - "id" => 32, - "category_id" => 100010, - "locale" => "zh_cn", - "name" => "日用品", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 33, - "category_id" => 100010, - "locale" => "en", - "name" => "English日用品", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 54, - "category_id" => 100015, - "locale" => "zh_cn", - "name" => "化妆品3", - "content" => "化妆品3", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 55, - "category_id" => 100015, - "locale" => "en", - "name" => "化妆品3", - "content" => "化妆品3", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 60, - "category_id" => 100013, - "locale" => "zh_cn", - "name" => "夏季促销", - "content" => "夏季促销", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 61, - "category_id" => 100013, - "locale" => "en", - "name" => "Summer promotion", - "content" => "Summer promotion", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 72, - "category_id" => 100012, - "locale" => "zh_cn", - "name" => "男装", - "content" => "男装", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 73, - "category_id" => 100012, - "locale" => "en", - "name" => "cotta", - "content" => "cotta", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 78, - "category_id" => 100014, - "locale" => "zh_cn", - "name" => "上装", - "content" => "化妆品2", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 79, - "category_id" => 100014, - "locale" => "en", - "name" => "make up", - "content" => "化妆品2", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 82, - "category_id" => 100018, - "locale" => "zh_cn", - "name" => "下装", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 83, - "category_id" => 100018, - "locale" => "en", - "name" => "makeup and costume", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 84, - "category_id" => 100019, - "locale" => "zh_cn", - "name" => "棉衣", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 85, - "category_id" => 100019, - "locale" => "en", - "name" => "cotton-padded clothes", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 86, - "category_id" => 100020, - "locale" => "zh_cn", - "name" => "棉毛裤", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 87, - "category_id" => 100020, - "locale" => "en", - "name" => "cotton interlock trousers", - "content" => "", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 120, - "category_id" => 100011, - "locale" => "zh_cn", - "name" => "男装|女装", - "content" => "男装|女装", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 121, - "category_id" => 100011, - "locale" => "en", - "name" => "Fashion men's wear1", - "content" => "Fashion men's wear", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 130, - "category_id" => 100035, - "locale" => "zh_cn", - "name" => "智能冰箱", - "content" => "智能冰箱", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 131, - "category_id" => 100035, - "locale" => "en", - "name" => "智能冰箱", - "content" => "智能冰箱", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 150, - "category_id" => 100007, - "locale" => "zh_cn", - "name" => "运动户外", - "content" => "运动户外", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 151, - "category_id" => 100007, - "locale" => "en", - "name" => "Sports", - "content" => "Sports", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 152, - "category_id" => 100008, - "locale" => "zh_cn", - "name" => "电子数码", - "content" => "电子数码", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 153, - "category_id" => 100008, - "locale" => "en", - "name" => "Electron", - "content" => "Electron", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 154, - "category_id" => 100009, - "locale" => "zh_cn", - "name" => "帐篷", - "content" => "帐篷", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 155, - "category_id" => 100009, - "locale" => "en", - "name" => "Tent", - "content" => "Tent", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 156, - "category_id" => 100004, - "locale" => "zh_cn", - "name" => "相机", - "content" => "相机", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 157, - "category_id" => 100004, - "locale" => "en", - "name" => "Camera", - "content" => "Camera", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 158, - "category_id" => 100000, - "locale" => "zh_cn", - "name" => "夏季新品", - "content" => "夏季新品", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 159, - "category_id" => 100000, - "locale" => "en", - "name" => "Summer", - "content" => "Summer", - "meta_title" => "", - "meta_description" => "", - "meta_keyword" => "", - ], - [ - "id" => 160, + "id" => 3, "category_id" => 100003, "locale" => "zh_cn", "name" => "时尚潮流", "content" => "时尚潮流", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" ], [ - "id" => 161, + "id" => 4, "category_id" => 100003, "locale" => "en", "name" => "Fashion", "content" => "Fashion", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" ], [ - "id" => 162, - "category_id" => 100036, + "id" => 5, + "category_id" => 100004, "locale" => "zh_cn", - "name" => "冬季套装", - "content" => "", + "name" => "相机", + "content" => "相机", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" ], [ - "id" => 163, - "category_id" => 100036, + "id" => 6, + "category_id" => 100004, "locale" => "en", - "name" => "winter", + "name" => "Camera", + "content" => "Camera", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 7, + "category_id" => 100005, + "locale" => "zh_cn", + "name" => "特价购买", "content" => "", "meta_title" => "", "meta_description" => "", - "meta_keyword" => "", + "meta_keyword" => "" + ], + [ + "id" => 8, + "category_id" => 100005, + "locale" => "en", + "name" => "Special", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 9, + "category_id" => 100006, + "locale" => "zh_cn", + "name" => "运动户外", + "content" => "运动户外", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 10, + "category_id" => 100006, + "locale" => "en", + "name" => "Sports", + "content" => "Sports", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 11, + "category_id" => 100007, + "locale" => "zh_cn", + "name" => "电子数码", + "content" => "电子数码", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 12, + "category_id" => 100007, + "locale" => "en", + "name" => "Electron", + "content" => "Electron", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 13, + "category_id" => 100008, + "locale" => "zh_cn", + "name" => "帐篷", + "content" => "帐篷", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 14, + "category_id" => 100008, + "locale" => "en", + "name" => "Tent", + "content" => "Tent", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 15, + "category_id" => 100010, + "locale" => "zh_cn", + "name" => "男装女装", + "content" => "男装女装", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 16, + "category_id" => 100010, + "locale" => "en", + "name" => "Clothes", + "content" => "Fashion", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 17, + "category_id" => 100011, + "locale" => "zh_cn", + "name" => "男装", + "content" => "男装", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 18, + "category_id" => 100011, + "locale" => "en", + "name" => "Men", + "content" => "Men", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 19, + "category_id" => 100012, + "locale" => "zh_cn", + "name" => "夏季促销", + "content" => "夏季促销", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 20, + "category_id" => 100012, + "locale" => "en", + "name" => "Summer Promotion", + "content" => "Summer promotion", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 21, + "category_id" => 100013, + "locale" => "zh_cn", + "name" => "上装", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 22, + "category_id" => 100013, + "locale" => "en", + "name" => "Top", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 23, + "category_id" => 100014, + "locale" => "zh_cn", + "name" => "下装", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 24, + "category_id" => 100014, + "locale" => "en", + "name" => "Bottom", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 25, + "category_id" => 100015, + "locale" => "zh_cn", + "name" => "棉衣", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 26, + "category_id" => 100015, + "locale" => "en", + "name" => "Cotton", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 27, + "category_id" => 100016, + "locale" => "zh_cn", + "name" => "棉毛裤", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 28, + "category_id" => 100016, + "locale" => "en", + "name" => "Cotton Pants", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 29, + "category_id" => 100017, + "locale" => "zh_cn", + "name" => "智能冰箱", + "content" => "智能冰箱", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 30, + "category_id" => 100017, + "locale" => "en", + "name" => "IceBox", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 31, + "category_id" => 100018, + "locale" => "zh_cn", + "name" => "家用电器", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" + ], + [ + "id" => 32, + "category_id" => 100018, + "locale" => "en", + "name" => "Electric", + "content" => "", + "meta_title" => "", + "meta_description" => "", + "meta_keyword" => "" ] ]; } @@ -586,282 +406,33 @@ class CategoriesSeeder extends Seeder public function getCategoryPaths() { return [ - [ - "id" => 38, - "category_id" => 100010, - "path_id" => 100010, - "level" => 0, - ], - [ - "id" => 72, - "category_id" => 100013, - "path_id" => 100013, - "level" => 0, - ], - [ - "id" => 181, - "category_id" => 100011, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 182, - "category_id" => 100012, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 183, - "category_id" => 100012, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 184, - "category_id" => 100014, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 185, - "category_id" => 100014, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 186, - "category_id" => 100014, - "path_id" => 100014, - "level" => 2, - ], - [ - "id" => 187, - "category_id" => 100015, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 188, - "category_id" => 100015, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 189, - "category_id" => 100015, - "path_id" => 100014, - "level" => 2, - ], - [ - "id" => 190, - "category_id" => 100015, - "path_id" => 100015, - "level" => 3, - ], - [ - "id" => 191, - "category_id" => 100018, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 192, - "category_id" => 100018, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 193, - "category_id" => 100018, - "path_id" => 100018, - "level" => 2, - ], - [ - "id" => 194, - "category_id" => 100019, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 195, - "category_id" => 100019, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 196, - "category_id" => 100019, - "path_id" => 100014, - "level" => 2, - ], - [ - "id" => 197, - "category_id" => 100019, - "path_id" => 100019, - "level" => 3, - ], - [ - "id" => 198, - "category_id" => 100020, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 199, - "category_id" => 100020, - "path_id" => 100012, - "level" => 1, - ], - [ - "id" => 200, - "category_id" => 100020, - "path_id" => 100018, - "level" => 2, - ], - [ - "id" => 201, - "category_id" => 100020, - "path_id" => 100020, - "level" => 3, - ], - [ - "id" => 206, - "category_id" => 100035, - "path_id" => 100011, - "level" => 0, - ], - [ - "id" => 207, - "category_id" => 100035, - "path_id" => 100035, - "level" => 1, - ], - [ - "id" => 264, - "category_id" => 100007, - "path_id" => 100007, - "level" => 0, - ], - [ - "id" => 267, - "category_id" => 100008, - "path_id" => 100008, - "level" => 0, - ], - [ - "id" => 268, - "category_id" => 100009, - "path_id" => 100007, - "level" => 0, - ], - [ - "id" => 269, - "category_id" => 100009, - "path_id" => 100009, - "level" => 1, - ], - [ - "id" => 270, - "category_id" => 100004, - "path_id" => 100008, - "level" => 0, - ], - [ - "id" => 271, - "category_id" => 100004, - "path_id" => 100004, - "level" => 1, - ], - [ - "id" => 272, - "category_id" => 100005, - "path_id" => 100008, - "level" => 0, - ], - [ - "id" => 273, - "category_id" => 100005, - "path_id" => 100004, - "level" => 1, - ], - [ - "id" => 274, - "category_id" => 100005, - "path_id" => 100005, - "level" => 2, - ], - [ - "id" => 275, - "category_id" => 100000, - "path_id" => 100000, - "level" => 0, - ], - [ - "id" => 276, - "category_id" => 100000, - "path_id" => 100000, - "level" => 1, - ], - [ - "id" => 277, - "category_id" => 100002, - "path_id" => 100000, - "level" => 0, - ], - [ - "id" => 278, - "category_id" => 100002, - "path_id" => 100000, - "level" => 1, - ], - [ - "id" => 279, - "category_id" => 100002, - "path_id" => 100001, - "level" => 2, - ], - [ - "id" => 280, - "category_id" => 100002, - "path_id" => 100002, - "level" => 3, - ], - [ - "id" => 281, - "category_id" => 100003, - "path_id" => 100000, - "level" => 0, - ], - [ - "id" => 282, - "category_id" => 100003, - "path_id" => 100000, - "level" => 1, - ], - [ - "id" => 283, - "category_id" => 100003, - "path_id" => 100001, - "level" => 2, - ], - [ - "id" => 284, - "category_id" => 100003, - "path_id" => 100002, - "level" => 3, - ], - [ - "id" => 285, - "category_id" => 100003, - "path_id" => 100003, - "level" => 4, - ], - [ - "id" => 286, - "category_id" => 100036, - "path_id" => 100036, - "level" => 0, - ] + ["id" => 183, "category_id" => 100003, "path_id" => 100003, "level" => 0], + ["id" => 184, "category_id" => 100013, "path_id" => 100003, "level" => 0], + ["id" => 185, "category_id" => 100013, "path_id" => 100013, "level" => 1], + ["id" => 186, "category_id" => 100015, "path_id" => 100003, "level" => 0], + ["id" => 187, "category_id" => 100015, "path_id" => 100013, "level" => 1], + ["id" => 188, "category_id" => 100015, "path_id" => 100015, "level" => 2], + ["id" => 189, "category_id" => 100014, "path_id" => 100003, "level" => 0], + ["id" => 190, "category_id" => 100014, "path_id" => 100014, "level" => 1], + ["id" => 191, "category_id" => 100016, "path_id" => 100003, "level" => 0], + ["id" => 192, "category_id" => 100016, "path_id" => 100014, "level" => 1], + ["id" => 193, "category_id" => 100016, "path_id" => 100016, "level" => 2], + ["id" => 194, "category_id" => 100005, "path_id" => 100005, "level" => 0], + ["id" => 195, "category_id" => 100006, "path_id" => 100006, "level" => 0], + ["id" => 196, "category_id" => 100008, "path_id" => 100006, "level" => 0], + ["id" => 197, "category_id" => 100008, "path_id" => 100008, "level" => 1], + ["id" => 198, "category_id" => 100007, "path_id" => 100007, "level" => 0], + ["id" => 199, "category_id" => 100002, "path_id" => 100007, "level" => 0], + ["id" => 200, "category_id" => 100002, "path_id" => 100002, "level" => 1], + ["id" => 201, "category_id" => 100004, "path_id" => 100007, "level" => 0], + ["id" => 202, "category_id" => 100004, "path_id" => 100004, "level" => 1], + ["id" => 204, "category_id" => 100010, "path_id" => 100010, "level" => 0], + ["id" => 205, "category_id" => 100011, "path_id" => 100010, "level" => 0], + ["id" => 206, "category_id" => 100011, "path_id" => 100011, "level" => 1], + ["id" => 207, "category_id" => 100012, "path_id" => 100012, "level" => 0], + ["id" => 208, "category_id" => 100018, "path_id" => 100018, "level" => 0], + ["id" => 209, "category_id" => 100017, "path_id" => 100018, "level" => 0], + ["id" => 210, "category_id" => 100017, "path_id" => 100017, "level" => 1] ]; } } diff --git a/database/seeders/SettingsSeeder.php b/database/seeders/SettingsSeeder.php index e10f11fb..9273b71e 100644 --- a/database/seeders/SettingsSeeder.php +++ b/database/seeders/SettingsSeeder.php @@ -503,740 +503,12 @@ class SettingsSeeder extends Seeder private function getMenuSetting() { - // $json = "{\"menus\":[{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"HOT\",\"zh_cn\":\"\u70ed\u5356\"],\"bg_color\":\"#fd560f\",\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"Sports\",\"zh_cn\":\"\u8fd0\u52a8\u6f6e\u5427\"],\"isChildren\":false,\"childrenGroup\":[{\"name\":{\"en\":\"leading the fashion\",\"zh_cn\":\"\u5f15\u9886\u65f6\u5c1a\"],\"type\":\"\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":3,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100000,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":3,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100008,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":5,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]],{\"name\":{\"en\":\"Special offer\",\"zh_cn\":\"\u7279\u4ef7\u4f18\u60e0\"],\"type\":\"link\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100000,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100008,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":6,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100003,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100009,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]],{\"name\":{\"en\":\"Popular products\",\"zh_cn\":\"\u7206\u6b3e\u5546\u54c1\"],\"type\":\"image\",\"image\":{\"image\":{\"en\":\"catalog\/demo\/banner\/2_en.jpg\",\"zh_cn\":\"catalog\/demo\/banner\/2.jpg\"],\"link\":{\"type\":\"product\",\"value\":1,\"text\":[],\"link\":\"\"}],\"children\":[]}]],{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"\",\"zh_cn\":\"\"],\"bg_color\":\"#fd560f\",\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"3C\",\"zh_cn\":\"\u7535\u5b50\u6570\u7801\"],\"isChildren\":false,\"childrenGroup\":[]],{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"NEW\",\"zh_cn\":\"\u65b0\u54c1\"],\"bg_color\":\"#7628A2\",\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"Fashion\",\"zh_cn\":\"\u65f6\u5c1a\u6f6e\u6d41\"],\"isChildren\":false,\"childrenGroup\":[{\"name\":{\"en\":\"global purchase\",\"zh_cn\":\"\u5168\u7403\u8d2d\"],\"type\":\"link\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":2,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\",\"new_window\":true}],{\"name\":[],\"link\":{\"type\":\"product\",\"value\":1,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100001,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"page\",\"value\":21,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]],{\"name\":{\"en\":\"Fashion\",\"zh_cn\":\"\u65f6\u5c1a\"],\"type\":\"image\",\"image\":{\"image\":{\"en\":\"catalog\/demo\/product\/16.jpg\",\"zh_cn\":\"catalog\/demo\/product\/16.jpg\"],\"link\":{\"type\":\"category\",\"value\":100001,\"text\":[],\"link\":\"\"}],\"children\":[{\"name\":[],\"link\":{\"type\":\"custom\",\"value\":\"https:\/\/www.baidu.com\",\"text\":{\"en\":\"\",\"zh_cn\":\"baidu \"],\"link\":\"\",\"new_window\":true}}]],{\"name\":{\"en\":\"recommended\",\"zh_cn\":\"\u5e97\u957f\u63a8\u8350\"],\"type\":\"image\",\"image\":{\"image\":{\"en\":\"catalog\/demo\/product\/13.jpg\",\"zh_cn\":\"catalog\/demo\/product\/13.jpg\"],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[],\"link\":\"\"}],\"children\":[]}]],{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"\",\"zh_cn\":\"\"],\"bg_color\":\"#fd560f\",\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"Digital\",\"zh_cn\":\"\u6570\u7801\u4ea7\u54c1\"],\"isChildren\":false,\"childrenGroup\":[{\"name\":{\"en\":\"\u5927\u724c\u4fc3\u9500\",\"zh_cn\":\"\u5927\u724c\u4fc3\u9500\"],\"type\":\"\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":2,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":8,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":9,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":1,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":6,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]],{\"name\":{\"en\":\"\",\"zh_cn\":\"\u6d3b\u52a8\u793c\u54c1\"],\"type\":\"\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100000,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100002,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100001,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"category\",\"value\":100007,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"static\",\"value\":\"account.order.index\",\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]],{\"name\":{\"en\":\"\",\"zh_cn\":\"\u5168\u573a\u4e09\u6298\"],\"type\":\"\",\"image\":{\"image\":[],\"link\":{\"type\":\"product\",\"value\":\"\",\"text\":[]}],\"children\":[{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":2,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":6,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":10,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":3,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}],{\"name\":[],\"link\":{\"type\":\"brand\",\"value\":1,\"text\":{\"en\":\"\",\"zh_cn\":\"\"],\"link\":\"\"}}]}]],{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"\",\"zh_cn\":\"\"],\"bg_color\":null,\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"Hot Deals\",\"zh_cn\":\"\u70ed\u5356\u7279\u60e0\"],\"isChildren\":false,\"childrenGroup\":[]],{\"isFull\":false,\"badge\":{\"isShow\":false,\"name\":{\"en\":\"Sales\",\"zh_cn\":\"\u5927\u724c\u76f4\u9500\"],\"bg_color\":\"#00C5C5\",\"text_color\":\"#ffffff\"],\"link\":{\"type\":\"page\",\"value\":\"\",\"text\":[],\"link\":\"\"],\"name\":{\"en\":\"Brand\",\"zh_cn\":\"\u56fd\u9645\u6f6e\u724c\"],\"isChildren\":false,\"childrenGroup\":[]}]}"; - $data = [ - "menus" => [ - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "HOT", - "zh_cn" => "热卖" - ], - "bg_color" => "#fd560f", - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "Sports", - "zh_cn" => "运动潮吧" - ], - "isChildren" => false, - "childrenGroup" => [ - [ - "name" => [ - "en" => "leading the fashion", - "zh_cn" => "引领时尚" - ], - "type" => "", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 3, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100000, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 3, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100008, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 5, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ], - [ - "name" => [ - "en" => "Special offer", - "zh_cn" => "特价优惠" - ], - "type" => "link", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100000, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100008, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 6, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100003, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100009, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ], - [ - "name" => [ - "en" => "Popular products", - "zh_cn" => "爆款商品" - ], - "type" => "image", - "image" => [ - "image" => [ - "en" => "catalog/demo/banner/2_en.jpg", - "zh_cn" => "catalog/demo/banner/2.jpg" - ], - "link" => [ - "type" => "product", - "value" => 1, - "text" => [ - ], - "link" => "" - ] - ], - "children" => [ - ] - ] - ] - ], - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "", - "zh_cn" => "" - ], - "bg_color" => "#fd560f", - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "3C", - "zh_cn" => "电子数码" - ], - "isChildren" => false, - "childrenGroup" => [ - ] - ], - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "NEW", - "zh_cn" => "新品" - ], - "bg_color" => "#7628A2", - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "Fashion", - "zh_cn" => "时尚潮流" - ], - "isChildren" => false, - "childrenGroup" => [ - [ - "name" => [ - "en" => "global purchase", - "zh_cn" => "全球购" - ], - "type" => "link", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 2, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "", - "new_window" => true - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "product", - "value" => 1, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100001, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "page", - "value" => 21, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ], - [ - "name" => [ - "en" => "Fashion", - "zh_cn" => "时尚" - ], - "type" => "image", - "image" => [ - "image" => [ - "en" => "catalog/demo/product/16.jpg", - "zh_cn" => "catalog/demo/product/16.jpg" - ], - "link" => [ - "type" => "category", - "value" => 100001, - "text" => [ - ], - "link" => "" - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "custom", - "value" => "https://www.baidu.com", - "text" => [ - "en" => "", - "zh_cn" => "baidu " - ], - "link" => "", - "new_window" => true - ] - ] - ] - ], - [ - "name" => [ - "en" => "recommended", - "zh_cn" => "店长推荐" - ], - "type" => "image", - "image" => [ - "image" => [ - "en" => "catalog/demo/product/13.jpg", - "zh_cn" => "catalog/demo/product/13.jpg" - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ], - "link" => "" - ] - ], - "children" => [ - ] - ] - ] - ], - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "", - "zh_cn" => "" - ], - "bg_color" => "#fd560f", - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "Digital", - "zh_cn" => "数码产品" - ], - "isChildren" => false, - "childrenGroup" => [ - [ - "name" => [ - "en" => "大牌促销", - "zh_cn" => "大牌促销" - ], - "type" => "", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 2, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 8, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 9, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 1, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 6, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ], - [ - "name" => [ - "en" => "", - "zh_cn" => "活动礼品" - ], - "type" => "", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100000, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100002, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100001, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "category", - "value" => 100007, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "static", - "value" => "account.order.index", - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ], - [ - "name" => [ - "en" => "", - "zh_cn" => "全场三折" - ], - "type" => "", - "image" => [ - "image" => [ - ], - "link" => [ - "type" => "product", - "value" => "", - "text" => [ - ] - ] - ], - "children" => [ - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 2, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 6, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 10, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 3, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ], - [ - "name" => [ - ], - "link" => [ - "type" => "brand", - "value" => 1, - "text" => [ - "en" => "", - "zh_cn" => "" - ], - "link" => "" - ] - ] - ] - ] - ] - ], - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "", - "zh_cn" => "" - ], - "bg_color" => null, - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "Hot Deals", - "zh_cn" => "热卖特惠" - ], - "isChildren" => false, - "childrenGroup" => [ - ] - ], - [ - "isFull" => false, - "badge" => [ - "isShow" => false, - "name" => [ - "en" => "Sales", - "zh_cn" => "大牌直销" - ], - "bg_color" => "#00C5C5", - "text_color" => "#ffffff" - ], - "link" => [ - "type" => "page", - "value" => "", - "text" => [ - ], - "link" => "" - ], - "name" => [ - "en" => "Brand", - "zh_cn" => "国际潮牌" - ], - "isChildren" => false, - "childrenGroup" => [ - ] - ] - ] - ]; - return json_encode($data); + $json = '{"menus":[{"isFull":false,"badge":{"isShow":false,"name":{"en":"","zh_cn":""},"bg_color":"#fd560f","text_color":"#ffffff"},"link":{"type":"page","value":"","text":[],"link":""},"name":{"en":"Sports","zh_cn":"\u8fd0\u52a8\u6f6e\u5427"},"isChildren":false,"childrenGroup":[{"name":{"en":"leading the fashion","zh_cn":"\u5f15\u9886\u65f6\u5c1a"},"type":"","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"brand","value":3,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"category","value":100008,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":5,"text":{"en":"","zh_cn":""},"link":""}}]},{"name":{"en":"Special offer","zh_cn":"\u7279\u4ef7\u4f18\u60e0"},"type":"link","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"category","value":100008,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":6,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"category","value":100003,"text":{"en":"","zh_cn":""},"link":""}}]},{"name":{"en":"Popular products","zh_cn":"\u7206\u6b3e\u5546\u54c1"},"type":"image","image":{"image":{"en":"catalog\/demo\/banner\/2_en.jpg","zh_cn":"catalog\/demo\/banner\/2.jpg"},"link":{"type":"product","value":1,"text":[],"link":""}},"children":[]}]},{"isFull":false,"badge":{"isShow":false,"name":{"en":"NEW","zh_cn":"\u65b0\u54c1"},"bg_color":"#7628A2","text_color":"#ffffff"},"link":{"type":"category","value":100003,"text":[],"link":""},"name":{"en":"Fashion","zh_cn":"\u65f6\u5c1a\u6f6e\u6d41"},"isChildren":false,"childrenGroup":[{"name":{"en":"global purchase","zh_cn":"\u5168\u7403\u8d2d"},"type":"link","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"brand","value":2,"text":{"en":"","zh_cn":""},"link":"","new_window":true}},{"name":[],"link":{"type":"product","value":1,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"category","value":100001,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"page","value":21,"text":{"en":"","zh_cn":""},"link":""}}]},{"name":{"en":"Fashion","zh_cn":"\u65f6\u5c1a"},"type":"image","image":{"image":{"en":"catalog\/demo\/product\/16.jpg","zh_cn":"catalog\/demo\/product\/16.jpg"},"link":{"type":"category","value":100001,"text":[],"link":""}},"children":[{"name":[],"link":{"type":"custom","value":"https:\/\/www.baidu.com","text":{"en":"","zh_cn":"baidu "},"link":"","new_window":true}}]},{"name":{"en":"recommended","zh_cn":"\u5e97\u957f\u63a8\u8350"},"type":"image","image":{"image":{"en":"catalog\/demo\/product\/13.jpg","zh_cn":"catalog\/demo\/product\/13.jpg"},"link":{"type":"product","value":"","text":[],"link":""}},"children":[]}]},{"isFull":false,"badge":{"isShow":false,"name":{"en":"","zh_cn":""},"bg_color":"#fd560f","text_color":"#ffffff"},"link":{"type":"category","value":100007,"text":[],"link":""},"name":{"en":"Digital","zh_cn":"\u6570\u7801\u4ea7\u54c1"},"isChildren":false,"childrenGroup":[{"name":{"en":"\u5927\u724c\u4fc3\u9500","zh_cn":"\u5927\u724c\u4fc3\u9500"},"type":"","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"brand","value":2,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":8,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":9,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":1,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":6,"text":{"en":"","zh_cn":""},"link":""}}]},{"name":{"en":"","zh_cn":"\u6d3b\u52a8\u793c\u54c1"},"type":"","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"category","value":100002,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"category","value":100007,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"static","value":"account.order.index","text":{"en":"","zh_cn":""},"link":""}}]},{"name":{"en":"","zh_cn":"\u5168\u573a\u4e09\u6298"},"type":"","image":{"image":[],"link":{"type":"product","value":"","text":[]}},"children":[{"name":[],"link":{"type":"brand","value":2,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":6,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":10,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":3,"text":{"en":"","zh_cn":""},"link":""}},{"name":[],"link":{"type":"brand","value":1,"text":{"en":"","zh_cn":""},"link":""}}]}]},{"isFull":false,"badge":{"isShow":false,"name":{"en":"Hot","zh_cn":"\u70ed\u5356"},"bg_color":"#FF4D00","text_color":"#ffffff"},"link":{"type":"page","value":"","text":[],"link":""},"name":{"en":"Hot","zh_cn":"\u70ed\u5356\u7279\u60e0"},"isChildren":false,"childrenGroup":[]},{"isFull":false,"badge":{"isShow":false,"name":{"en":"Sales","zh_cn":"\u5927\u724c\u76f4\u9500"},"bg_color":"#00C5C5","text_color":"#ffffff"},"link":{"type":"page","value":"","text":[],"link":""},"name":{"en":"Brand","zh_cn":"\u56fd\u9645\u6f6e\u724c"},"isChildren":false,"childrenGroup":[]}]}'; + $setting = json_decode($json, true); + if (empty($setting)) { + throw new \Exception("无效的菜单设置"); + } + return json_encode($setting); } private function getHomeSetting()