英文下拉

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
+6 -2
View File
@@ -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);
}
+7
View File
@@ -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);
}
+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);
}
+1 -1
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
}
}
+17
View File
@@ -19,6 +19,14 @@ class Constants
self::CUSTOMER_GRADE_SALES => '售后阶段',
self::CUSTOMER_GRADE_LOSS => '停滞或流失',
];
public const GRADE_EN = [
self::CUSTOMER_GRADE_INITIAL => 'Initial contact',
self::CUSTOMER_GRADE_COMMUNICATE => 'Demand Chat',
self::CUSTOMER_GRADE_PLAN => 'promotion of the plan',
self::CUSTOMER_GRADE_DEAL => 'Transaction Stage',
self::CUSTOMER_GRADE_SALES => 'After Sales',
self::CUSTOMER_GRADE_LOSS => 'Stagnation or loss',
];
//客户重要性
public const CUSTOMER_MAGNITUDE_INITIAL = 0; // 金牌商机
@@ -30,6 +38,11 @@ class Constants
self::CUSTOMER_MAGNITUDE_COMMUNICATE => '银牌商机',
self::CUSTOMER_MAGNITUDE_PLAN => '铜牌商机',
];
public const MAGNITUDE_EN = [
self::CUSTOMER_MAGNITUDE_INITIAL => 'Gold Medal',
self::CUSTOMER_MAGNITUDE_COMMUNICATE => 'Silver Medal',
self::CUSTOMER_MAGNITUDE_PLAN => 'Bronze Medal',
];
//跟进类型
@@ -40,6 +53,10 @@ class Constants
self::CUSTOMER_FOLLOW_VISIT => '线下拜访',
self::CUSTOMER_FOLLOW_UP => '线上跟进',
];
public const FOLLOW_EN = [
self::CUSTOMER_FOLLOW_VISIT => 'Visit',
self::CUSTOMER_FOLLOW_UP => 'On line',
];
//跟进类型
public const CUSTOMER_SEX_UNKNOWN = 0; // 未知