英文下拉
This commit is contained in:
@@ -41,10 +41,14 @@ class AreaController
|
|||||||
|
|
||||||
public function getCountry (Request $request)
|
public function getCountry (Request $request)
|
||||||
{
|
{
|
||||||
$level = Util::getParam($request,'level')?:1;
|
|
||||||
$list = Country::get()->toArray();
|
$list = Country::get()->toArray();
|
||||||
|
$language = 'en_addr';
|
||||||
|
if($request->user['language'] == 'zh_CN'){
|
||||||
|
$language = 'cn_addr';
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($list as &$row) {
|
foreach ($list as &$row) {
|
||||||
$row['name'] = $row['cn_addr'];
|
$row['name'] = $row[$language];
|
||||||
}
|
}
|
||||||
return Util::success($list);
|
return Util::success($list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ class CarTypeController
|
|||||||
public function getAll(Request $request)
|
public function getAll(Request $request)
|
||||||
{
|
{
|
||||||
$list = CarType::getAll();
|
$list = CarType::getAll();
|
||||||
|
|
||||||
|
if($request->user['language'] != 'zh_CN'){
|
||||||
|
foreach ($list as $key => &$value) {
|
||||||
|
$value['name'] = $value['name_en'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Util::success($list);
|
return Util::success($list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ class CustomerController
|
|||||||
public function getGrade(Request $request)
|
public function getGrade(Request $request)
|
||||||
{
|
{
|
||||||
$grade = [];
|
$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[] = [
|
$grade[] = [
|
||||||
'id' => $key,
|
'id' => $key,
|
||||||
'name' => $value,
|
'name' => $value,
|
||||||
@@ -37,7 +41,11 @@ class CustomerController
|
|||||||
public function getMagnitude(Request $request)
|
public function getMagnitude(Request $request)
|
||||||
{
|
{
|
||||||
$grade = [];
|
$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[] = [
|
$grade[] = [
|
||||||
'id' => $key,
|
'id' => $key,
|
||||||
'name' => $value,
|
'name' => $value,
|
||||||
@@ -54,6 +62,13 @@ class CustomerController
|
|||||||
public function getChannel(Request $request)
|
public function getChannel(Request $request)
|
||||||
{
|
{
|
||||||
$list = Channel::getAll();
|
$list = Channel::getAll();
|
||||||
|
|
||||||
|
if($request->user['language'] != 'zh_CN'){
|
||||||
|
foreach ($list as $key => &$value) {
|
||||||
|
$value['name'] = $value['name_en'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Util::success($list);
|
return Util::success($list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class CarType extends Model
|
|||||||
|
|
||||||
public static function getAll()
|
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;
|
return $list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ class Channel extends Model
|
|||||||
|
|
||||||
public static function getAll()
|
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;
|
return $list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,6 +19,14 @@ class Constants
|
|||||||
self::CUSTOMER_GRADE_SALES => '售后阶段',
|
self::CUSTOMER_GRADE_SALES => '售后阶段',
|
||||||
self::CUSTOMER_GRADE_LOSS => '停滞或流失',
|
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; // 金牌商机
|
public const CUSTOMER_MAGNITUDE_INITIAL = 0; // 金牌商机
|
||||||
@@ -30,6 +38,11 @@ class Constants
|
|||||||
self::CUSTOMER_MAGNITUDE_COMMUNICATE => '银牌商机',
|
self::CUSTOMER_MAGNITUDE_COMMUNICATE => '银牌商机',
|
||||||
self::CUSTOMER_MAGNITUDE_PLAN => '铜牌商机',
|
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_VISIT => '线下拜访',
|
||||||
self::CUSTOMER_FOLLOW_UP => '线上跟进',
|
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; // 未知
|
public const CUSTOMER_SEX_UNKNOWN = 0; // 未知
|
||||||
|
|||||||
Reference in New Issue
Block a user