This commit is contained in:
2025-03-27 13:34:10 +08:00
parent aff152e40d
commit 16a7ea2976
2 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -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;
}