英文下拉

This commit is contained in:
2025-03-25 09:06:08 +08:00
parent 06f2531ec0
commit 6184f69ddd
6 changed files with 49 additions and 6 deletions
+17 -2
View File
@@ -20,7 +20,11 @@ class CustomerController
public function getGrade(Request $request)
{
$grade = [];
foreach (Constants::GRADE as $key => $value) {
$gradeConstants = Constants::GRADE_EN;
if($request->user['language'] == 'zh_CN'){
$gradeConstants = Constants::GRADE;
}
foreach ($gradeConstants as $key => $value) {
$grade[] = [
'id' => $key,
'name' => $value,
@@ -37,7 +41,11 @@ class CustomerController
public function getMagnitude(Request $request)
{
$grade = [];
foreach (Constants::MAGNITUDE as $key => $value) {
$magnitudeConstants = Constants::MAGNITUDE_EN;
if($request->user['language'] == 'zh_CN'){
$magnitudeConstants = Constants::MAGNITUDE;
}
foreach ($magnitudeConstants as $key => $value) {
$grade[] = [
'id' => $key,
'name' => $value,
@@ -54,6 +62,13 @@ class CustomerController
public function getChannel(Request $request)
{
$list = Channel::getAll();
if($request->user['language'] != 'zh_CN'){
foreach ($list as $key => &$value) {
$value['name'] = $value['name_en'];
}
}
return Util::success($list);
}