diff --git a/beike/Models/Plugin.php b/beike/Models/Plugin.php
index 50aae3d9..d6c67664 100644
--- a/beike/Models/Plugin.php
+++ b/beike/Models/Plugin.php
@@ -19,6 +19,8 @@ class Plugin extends Base
'total', // 订单金额
'social', // 社交网络
'feature', // 功能模块
+ 'language', // 语言翻译
+ 'theme', // 主题模板
];
protected $fillable = ['type', 'code'];
diff --git a/plugins/Bestseller/Admin/View/DesignBuilders/Bestseller.php b/plugins/Bestseller/Admin/View/DesignBuilders/Bestseller.php
index 319d15d5..fd236855 100644
--- a/plugins/Bestseller/Admin/View/DesignBuilders/Bestseller.php
+++ b/plugins/Bestseller/Admin/View/DesignBuilders/Bestseller.php
@@ -33,11 +33,10 @@ class Bestseller extends Component
public function render(): View
{
$data['register'] = [
- 'code' => 'bestseller',
- 'sort' => 0,
- // 'name' => trans('admin/design_builder.module_brand'),
- 'name' => 'Bestseller',
- 'icon' => '',
+ 'code' => 'bestseller',
+ 'sort' => 0,
+ 'name' => trans('Bestseller::common.module_name'),
+ 'icon' => plugin_asset('Bestseller', 'image/icon.png'),
'view_path' => 'Bestseller::shop/design_module_bestseller',
];
diff --git a/plugins/Bestseller/Bootstrap.php b/plugins/Bestseller/Bootstrap.php
index 67eb1a88..4eee1eef 100644
--- a/plugins/Bestseller/Bootstrap.php
+++ b/plugins/Bestseller/Bootstrap.php
@@ -33,7 +33,7 @@ class Bootstrap
$module = $data['module_code'] ?? '';
if ($module == 'bestseller') {
- $data['title'] = $data['title'][locale()] ?? '';
+ $data['title'] = $data['title'][locale()] ?? '';
$data['products'] = ProductRepo::getBestSellerProducts($data['limit']);
}
diff --git a/plugins/Bestseller/Lang/en/common.php b/plugins/Bestseller/Lang/en/common.php
new file mode 100644
index 00000000..bcc7a8e9
--- /dev/null
+++ b/plugins/Bestseller/Lang/en/common.php
@@ -0,0 +1,15 @@
+
+ * @created 2022-07-28 16:19:06
+ * @modified 2022-07-28 16:19:06
+ */
+
+return [
+ 'module_name' => 'Bestseller',
+ 'limit' => 'Limit',
+];
diff --git a/plugins/Bestseller/Lang/zh_cn/common.php b/plugins/Bestseller/Lang/zh_cn/common.php
new file mode 100644
index 00000000..e962884f
--- /dev/null
+++ b/plugins/Bestseller/Lang/zh_cn/common.php
@@ -0,0 +1,15 @@
+
+ * @created 2022-07-28 16:19:06
+ * @modified 2022-07-28 16:19:06
+ */
+
+return [
+ 'module_name' => '热卖模块',
+ 'limit' => '数量限制',
+];
diff --git a/plugins/Bestseller/Repositories/ProductRepo.php b/plugins/Bestseller/Repositories/ProductRepo.php
index 6d0da567..525ca388 100644
--- a/plugins/Bestseller/Repositories/ProductRepo.php
+++ b/plugins/Bestseller/Repositories/ProductRepo.php
@@ -25,11 +25,12 @@ class ProductRepo
{
$products = \Beike\Repositories\ProductRepo::getBuilder([
'active' => 1,
- 'sort' => 'products.sales',
- 'order' => 'desc',
+ 'sort' => 'products.sales',
+ 'order' => 'desc',
])
->whereHas('masterSku')
->limit($limit)->get();
+
return ProductSimple::collection($products)->jsonSerialize();
}
}
diff --git a/plugins/Bestseller/Static/image/icon.png b/plugins/Bestseller/Static/image/icon.png
new file mode 100644
index 00000000..00aafdab
Binary files /dev/null and b/plugins/Bestseller/Static/image/icon.png differ
diff --git a/plugins/Bestseller/Views/admin/design_module_bestseller.blade.php b/plugins/Bestseller/Views/admin/design_module_bestseller.blade.php
index b8ad345c..eda73c16 100644
--- a/plugins/Bestseller/Views/admin/design_module_bestseller.blade.php
+++ b/plugins/Bestseller/Views/admin/design_module_bestseller.blade.php
@@ -6,7 +6,7 @@