This commit is contained in:
2025-07-15 13:52:31 +08:00
parent d102e61ddb
commit 9a13c23788
6 changed files with 17 additions and 10 deletions
+2 -2
View File
@@ -66,7 +66,7 @@ class Customer extends Model
*/
public static function getCustomer($customer, $request, $tag = false)
{
$language = $request->user['language'] ?: 'en';
$language = 'zh_CN' ?: 'en';
$customer['grade_txt'] = Util::language($language, Constants::GRADE_EN[$customer['grade']], Constants::GRADE_ZH[$customer['grade']], Constants::GRADE_RU[$customer['grade']]);
$customer['magnitude_txt'] = Util::language($language, Constants::MAGNITUDE_EN[$customer['magnitude']], Constants::MAGNITUDE[$customer['magnitude']], Constants::MAGNITUDE_RU[$customer['magnitude']]);
$customer['sex_txt'] = Util::language($language, Constants::SEX_EN[$customer['sex']], Constants::SEX[$customer['sex']], Constants::SEX_RU[$customer['sex']]);
@@ -117,7 +117,7 @@ class Customer extends Model
*/
public function tags()
{
return $this->belongsToMany(Tag::class, 'customer_tag', 'customer_id', 'tag_id')
return $this->belongsToMany(Tag::class, 'crm_customer_tag', 'customer_id', 'tag_id')
->withTimestamps(); // 如果需要记录关联时间
}
+1 -1
View File
@@ -14,7 +14,7 @@ class CustomerTag extends Model
*
* @var string
*/
protected $table = 'customer_tag';
protected $table = 'crm_customer_tag';
/**
* The primary key associated with the table.
+1 -1
View File
@@ -50,6 +50,6 @@ class Tag extends Model
public function customers()
{
return $this->belongsToMany(Customer::class, 'customer_tag', 'tag_id', 'customer_id');
return $this->belongsToMany(Customer::class, 'crm_customer_tag', 'tag_id', 'customer_id');
}
}