Bläddra i källkod

增加英文支持

kphcdr 1 år sedan
förälder
incheckning
21a65d8545

+ 1 - 0
app/Modules/Admin/Controllers/Admin/CommonController.php

@@ -85,6 +85,7 @@ class CommonController extends BaseController
                 return [
                     "id" => $c->id,
                     "name" => $c->title,
+                    "en_name" => $c->en_title,
                 ];
             }),
         ]);

+ 3 - 1
app/Modules/Admin/Services/OrderService.php

@@ -48,9 +48,11 @@ class OrderService extends BaseService
                             "goods_sn" => $goods->sn,
                             "goods_count" => $goods->count,
                             "custom" => array_map(function ($custom) {
+                                $custom = GoodsCustom::where("id", $custom['custom_id'])->first();
                                 return [
                                     "custom_id" => $custom['custom_id'],
-                                    "title" => GoodsCustom::where("id", $custom['custom_id'])->value("title"),
+                                    "title" => $custom->title,
+                                    "en_title" => $custom->en_title,
                                     "value" => $custom['value'] ?? "",
                                 ];
                             }, $goods->custom ?? []),

+ 3 - 1
app/Modules/Mini/Services/OrderService.php

@@ -109,9 +109,11 @@ class OrderService extends BaseService
                             "goods_sn" => $goods->sn,
                             "goods_count" => $goods->count,
                             "custom" => array_map(function ($custom) {
+                                $custom = GoodsCustom::where("id", $custom['custom_id'])->first();
                                 return [
                                     "custom_id" => $custom['custom_id'],
-                                    "title" => GoodsCustom::where("id", $custom['custom_id'])->value("title"),
+                                    "title" => $custom->title,
+                                    "en_title" => $custom->en_title,
                                     "value" => $custom['value'] ?? "",
                                 ];
                             }, $goods->custom ?? []),