fixed page and page category demo.

This commit is contained in:
Edward Yang 2023-06-14 19:04:05 +08:00
parent 4cffc1a159
commit 0b11ada7a2
3 changed files with 274 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class DatabaseSeeder extends Seeder
CustomerGroupsSeeder::class,
LanguagesSeeder::class,
PagesSeeder::class,
PageCategoriesSeeder::class,
PluginsSeeder::class,
ZonesSeeder::class,
ProductsSeeder::class,

View File

@ -0,0 +1,213 @@
<?php
/**
* PageCategoriesSeeder.php
*
* @copyright 2023 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <yangjin@guangda.work>
* @created 2023-06-14 18:51:18
* @modified 2023-06-14 18:51:18
*/
namespace Database\Seeders;
use Beike\Models\PageCategory;
use Beike\Models\PageCategoryDescription;
use Illuminate\Database\Seeder;
class PageCategoriesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$items = $this->getPageCategories();
if ($items) {
PageCategory::query()->truncate();
foreach ($items as $item) {
PageCategory::query()->create($item);
}
}
$items = $this->getPageCategoryDescriptions();
if ($items) {
PageCategoryDescription::query()->truncate();
foreach ($items as $item) {
PageCategoryDescription::query()->create($item);
}
}
}
public function getPageCategories()
{
return [
[
"id" => 1,
"parent_id" => 0,
"position" => 0,
"active" => 1,
],
[
"id" => 2,
"parent_id" => 0,
"position" => 0,
"active" => 1,
],
[
"id" => 3,
"parent_id" => 0,
"position" => 0,
"active" => 1,
],
[
"id" => 4,
"parent_id" => 0,
"position" => 0,
"active" => 1,
],
[
"id" => 5,
"parent_id" => 0,
"position" => 0,
"active" => 1
],
[
"id" => 6,
"parent_id" => 0,
"position" => 0,
"active" => 1
]
];
}
public function getPageCategoryDescriptions()
{
return [
[
"id" =>1,
"page_category_id" =>1,
"locale" =>"zh_cn",
"title" =>"公司新闻",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>2,
"page_category_id" =>1,
"locale" =>"en",
"title" =>"News",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>3,
"page_category_id" =>2,
"locale" =>"zh_cn",
"title" =>"行业新闻",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>4,
"page_category_id" =>2,
"locale" =>"en",
"title" =>"Industry News",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>5,
"page_category_id" =>3,
"locale" =>"zh_cn",
"title" =>"聚焦热点",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>6,
"page_category_id" =>3,
"locale" =>"en",
"title" =>"Focus on hot spots",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>7,
"page_category_id" =>4,
"locale" =>"zh_cn",
"title" =>"时尚潮流",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>8,
"page_category_id" =>4,
"locale" =>"en",
"title" =>"Fashion",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>9,
"page_category_id" =>5,
"locale" =>"zh_cn",
"title" =>"顶尖设计",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>10,
"page_category_id" =>5,
"locale" =>"en",
"title" =>"Top design",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>11,
"page_category_id" =>6,
"locale" =>"zh_cn",
"title" =>"尖货大卖",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>12,
"page_category_id" =>6,
"locale" =>"en",
"title" =>"Good Deals",
"summary" =>"",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
]
];
}
}

View File

@ -78,6 +78,22 @@ class PagesSeeder extends Seeder
'author' => 'BeikeShop',
'active' => 1
],
[
"id" =>22,
"page_category_id" =>1,
"position" =>0,
"views" =>1,
"author" =>"BeikeShop",
"active" =>1,
],
[
"id" =>23,
"page_category_id" =>1,
"position" =>0,
"views" =>1,
"author" =>"BeikeShop",
"active" =>1,
]
];
}
@ -188,6 +204,50 @@ class PagesSeeder extends Seeder
"created_at" => "2022-09-02 11:04:30",
"updated_at" => "2022-09-02 11:04:30"
],
[
"id" =>199,
"page_id" =>22,
"locale" =>"zh_cn",
"title" =>"Beikeshop 1.3.7 新版版本发布!!!",
"summary" =>"",
"content" =>"<p>Beikeshop 1.3.7 新版版本发布!!!</p>",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>200,
"page_id" =>22,
"locale" =>"en",
"title" =>"Beikeshop 1.3.7 new version released! ! !",
"summary" =>"",
"content" =>"<p>Beikeshop 1.3.7 new version released! ! !</p>",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>203,
"page_id" =>23,
"locale" =>"zh_cn",
"title" =>"新一代开源跨境电商系统BeikeShop重磅上线",
"summary" =>"",
"content" =>"随着一带一路的蓬勃发展以及中国制造亟需出海拓展全球市场外贸行业仍然是大国创造GDP的核心引擎.光大网络科技长期深耕跨境电商行业,经过多年的摸索与思考,开发出了一套更加符合国内出海企业需求的开源电商系统&mdash;&mdash;BeikeShop&mdash;&mdash;助力企业品牌出海。",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
],
[
"id" =>204,
"page_id" =>23,
"locale" =>"en",
"title" =>"A new generation of open source cross-border e-commerce system, BeikeShop is launched!",
"summary" =>"",
"content" =>"随着一带一路的蓬勃发展以及中国制造亟需出海拓展全球市场外贸行业仍然是大国创造GDP的核心引擎.光大网络科技长期深耕跨境电商行业,经过多年的摸索与思考,开发出了一套更加符合国内出海企业需求的开源电商系统&mdash;&mdash;BeikeShop&mdash;&mdash;助力企业品牌出海",
"meta_title" =>"",
"meta_description" =>"",
"meta_keywords" =>"",
]
];
}
}