语言
This commit is contained in:
@@ -59,7 +59,7 @@ class Customer extends Model
|
||||
return $date->format(Carbon::parse($date)->toDateTimeString());
|
||||
}
|
||||
|
||||
public static function getCustomer($customer)
|
||||
public static function getCustomer($customer,$request = null)
|
||||
{
|
||||
$customer['grade_txt'] = Constants::GRADE[$customer['grade']];
|
||||
$customer['magnitude_txt'] = Constants::MAGNITUDE[$customer['magnitude']];
|
||||
@@ -94,6 +94,14 @@ class Customer extends Model
|
||||
$customer['channel_name'] = empty($customer['channel_id'])?'':Channel::where(['id'=>$customer['channel_id']])->value('name');
|
||||
// $customer['last_follow'] = $last_follow;
|
||||
|
||||
if (!empty($request)) {
|
||||
$language = $request->user['language'] ?: 'en';
|
||||
foreach ($customer['tags'] as &$tag) {
|
||||
$tag['names'] = unserialize($tag['names']);
|
||||
$tag['name'] = $tag['names'][$language];
|
||||
}
|
||||
}
|
||||
|
||||
return $customer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user