英文下拉
This commit is contained in:
@@ -41,10 +41,14 @@ class AreaController
|
||||
|
||||
public function getCountry (Request $request)
|
||||
{
|
||||
$level = Util::getParam($request,'level')?:1;
|
||||
$list = Country::get()->toArray();
|
||||
$language = 'en_addr';
|
||||
if($request->user['language'] == 'zh_CN'){
|
||||
$language = 'cn_addr';
|
||||
}
|
||||
|
||||
foreach ($list as &$row) {
|
||||
$row['name'] = $row['cn_addr'];
|
||||
$row['name'] = $row[$language];
|
||||
}
|
||||
return Util::success($list);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@ class CarTypeController
|
||||
public function getAll(Request $request)
|
||||
{
|
||||
$list = CarType::getAll();
|
||||
|
||||
if($request->user['language'] != 'zh_CN'){
|
||||
foreach ($list as $key => &$value) {
|
||||
$value['name'] = $value['name_en'];
|
||||
}
|
||||
}
|
||||
|
||||
return Util::success($list);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class CarType extends Model
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
$list = self::get()->select('id','name','status')->where('status',0)->toArray();
|
||||
$list = self::get()->select('id','name','name_en','status')->where('status',0)->toArray();
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class Channel extends Model
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
$list = self::get()->select('id','name','status')->where('status',0)->toArray();
|
||||
$list = self::get()->select('id','name','name_en','status')->where('status',0)->toArray();
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user