英文下拉
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user