2025-08-01 14:20:12 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\crmAdmin\service;
|
|
|
|
|
|
|
|
|
|
use app\common\model\User;
|
2025-08-01 17:18:08 +08:00
|
|
|
use app\crm\model\CustomerHis;
|
2025-08-01 14:20:12 +08:00
|
|
|
use app\crmAdmin\logic\CustomerLogic;
|
|
|
|
|
use app\crm\model\CarType;
|
|
|
|
|
use app\crm\model\Channel;
|
|
|
|
|
use app\crm\model\Country;
|
|
|
|
|
use app\crm\model\Customer;
|
|
|
|
|
use app\crm\model\Follow;
|
|
|
|
|
use app\crm\utils\Util;
|
|
|
|
|
use config\constants\Constants;
|
2025-08-01 17:18:08 +08:00
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Border;
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Fill;
|
2025-08-04 11:17:38 +08:00
|
|
|
use support\Db;
|
2025-08-01 14:20:12 +08:00
|
|
|
|
|
|
|
|
class CustomerService
|
|
|
|
|
{
|
|
|
|
|
public function list($params)
|
|
|
|
|
{
|
2025-08-01 17:18:08 +08:00
|
|
|
$customer = $this->search($params);
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询列表数据
|
|
|
|
|
* @param $params
|
|
|
|
|
* @param $export
|
|
|
|
|
* @return Customer[]|\Illuminate\Contracts\Pagination\LengthAwarePaginator|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Collection[]|\Illuminate\Pagination\LengthAwarePaginator
|
|
|
|
|
*/
|
2025-08-04 11:17:38 +08:00
|
|
|
public function search($params, $export = false)
|
|
|
|
|
{
|
2025-08-01 17:18:08 +08:00
|
|
|
|
2025-08-01 14:20:12 +08:00
|
|
|
// $page = $request->input('page', 1);
|
|
|
|
|
// $perPage = $request->input('per_page', 10);
|
|
|
|
|
$perPage = $params['size'] ?? 10;
|
|
|
|
|
$page = $params['current'] ?? 1;
|
|
|
|
|
$keyword = $params['keyword'] ?? '';
|
|
|
|
|
$recycle = $params['recycle'] ?? '';
|
|
|
|
|
$follow = $params['follow'] ?? '';
|
|
|
|
|
$follow_last = $params['follow_last'] ?? '';
|
|
|
|
|
$tagId = $params['tag_id'] ?? [];
|
|
|
|
|
$user_id = $params['user_id'] ?? '';
|
|
|
|
|
$seas = $params['seas'] ?? '';
|
|
|
|
|
$scene = $params['scene'] ?? '';
|
|
|
|
|
$where = [];
|
|
|
|
|
|
|
|
|
|
if ($scene == 'audit') {
|
2025-08-01 17:18:08 +08:00
|
|
|
$where[] = ['status', '=', 2];
|
2025-08-04 11:17:38 +08:00
|
|
|
} else {
|
2025-08-01 17:18:08 +08:00
|
|
|
$where[] = ['status', '=', 1];
|
2025-08-01 14:20:12 +08:00
|
|
|
}
|
2025-08-04 11:17:38 +08:00
|
|
|
if ($seas == 'seas' || $scene == 'seas') {
|
2025-08-01 14:20:12 +08:00
|
|
|
$where[] = ['user_id', 0];
|
|
|
|
|
}
|
|
|
|
|
// if($recycle == 'recycle'){
|
|
|
|
|
// $where[] = ['user_id', $user_id];
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$grade = [];
|
|
|
|
|
if (!Util::isEmpty($follow) && $follow == 0) {
|
|
|
|
|
$where[] = ['grade', '<=', 2];
|
|
|
|
|
} elseif (!Util::isEmpty($follow) && $follow == 1) {
|
|
|
|
|
$grade = [3, 4];
|
|
|
|
|
} elseif (!Util::isEmpty($follow) && $follow == 2) {
|
|
|
|
|
$where[] = ['grade', '=', 5];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Util::isEmpty($follow_last) && $follow_last == 0) {
|
|
|
|
|
$where[] = ['follow_last', '>', strtotime('-1 day')];
|
|
|
|
|
} elseif (!Util::isEmpty($follow_last) && $follow_last == 1) {
|
|
|
|
|
$where[] = ['follow_last', '>', strtotime('-3 day')];
|
|
|
|
|
} elseif (!Util::isEmpty($follow_last) && $follow_last == 2) {
|
|
|
|
|
$where[] = ['follow_last', '>', strtotime('-7 day')];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$query = Customer::where($where);
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
if (!empty($user_id)) {
|
|
|
|
|
$query->whereIn('user_id', explode(',', $user_id));
|
2025-08-05 16:06:55 +08:00
|
|
|
} elseif ($user_id === 0 && $export) {
|
|
|
|
|
$query->where('user_id', 0);
|
2025-08-01 14:20:12 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
if (!empty($tagId)) {
|
2025-08-01 14:20:12 +08:00
|
|
|
//查询有$tagId 里任意一个标签的客户
|
2025-08-05 14:13:31 +08:00
|
|
|
//$query->whereHas('crm_tag', function($query) use ($tagId){
|
2025-08-01 14:20:12 +08:00
|
|
|
// $query->whereIn ('tag.id', $tagId);
|
|
|
|
|
//});
|
|
|
|
|
//查询有$tagId 里所有标签的客户
|
|
|
|
|
foreach ($tagId as $id) {
|
2025-08-05 14:21:41 +08:00
|
|
|
$query->whereHas('tags', function($query) use ($id){
|
|
|
|
|
$query->where('tag_id', $id);
|
2025-08-01 14:20:12 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!Util::isEmpty($keyword)) {
|
|
|
|
|
$query->where(function ($query) use ($keyword) {
|
|
|
|
|
$query->where('contacts', 'like', "%{$keyword}%")
|
|
|
|
|
->orWhere('phone', 'like', "%{$keyword}%");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (!Util::isEmpty($grade)) {
|
|
|
|
|
$query->whereIn('grade', $grade);
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 14:59:38 +08:00
|
|
|
if ($recycle == 'recycle' || $scene == 'recycle' || $seas == 'seas' || $scene == 'seas' || $scene == 'audit') {
|
2025-08-01 14:20:12 +08:00
|
|
|
$query->onlyTrashed();
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
if (!$export) {
|
|
|
|
|
$customer = $query->orderBy('id', 'desc')->paginate($perPage, ['*'], 'page', $page);
|
|
|
|
|
} else {
|
|
|
|
|
$customer = $query->orderBy('id', 'desc')->get();
|
2025-08-01 17:18:08 +08:00
|
|
|
return $customer;
|
|
|
|
|
}
|
2025-08-04 11:17:38 +08:00
|
|
|
if (!$export) {
|
2025-08-01 17:18:08 +08:00
|
|
|
foreach ($customer as &$item) {
|
|
|
|
|
$item = $this->getCustomer($item);
|
2025-08-04 11:17:38 +08:00
|
|
|
if ($seas == 'seas' || $scene == 'seas') {
|
|
|
|
|
$item['seas_time'] = time() - strtotime($item['deleted_at']);
|
2025-08-01 17:18:08 +08:00
|
|
|
}
|
|
|
|
|
if ($scene == 'audit') { //审核时查询举报人姓名
|
2025-08-04 11:17:38 +08:00
|
|
|
$customerHis = CustomerHis::where('customer_id', $item->id)->orderBy('id', 'desc')->first(['user_his']);
|
2025-08-06 15:56:57 +08:00
|
|
|
var_dump($customerHis['user_his']);
|
|
|
|
|
$item['user_name'] = empty($customerHis['user_his']) ? '' : User::where('id',$customerHis['user_his'])->value('name');
|
2025-08-01 17:18:08 +08:00
|
|
|
}
|
2025-08-01 14:20:12 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($item);
|
|
|
|
|
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
public function export($params)
|
|
|
|
|
{
|
2025-08-05 16:06:55 +08:00
|
|
|
if(empty($param['user_id']) && empty($param['tag_id'])){
|
|
|
|
|
$params['user_id'] = 0;
|
|
|
|
|
}
|
2025-08-01 17:18:08 +08:00
|
|
|
$customers = $this->search($params, true);
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 创建新的Spreadsheet对象
|
|
|
|
|
$spreadsheet = new Spreadsheet();
|
|
|
|
|
$sheet = $spreadsheet->getActiveSheet();
|
2025-08-04 11:17:38 +08:00
|
|
|
|
|
|
|
|
// 设置表头
|
|
|
|
|
$headers = [
|
|
|
|
|
'A1' => '客户ID',
|
|
|
|
|
'B1' => '联系人',
|
|
|
|
|
'C1' => '电话',
|
|
|
|
|
'D1' => '邮箱',
|
|
|
|
|
'E1' => 'WhatsApp',
|
|
|
|
|
'F1' => '性别',
|
|
|
|
|
'G1' => '国家/地区',
|
|
|
|
|
'H1' => '渠道来源',
|
|
|
|
|
'I1' => '描述',
|
|
|
|
|
'J1' => '所属人',
|
|
|
|
|
'K1' => '录入人',
|
|
|
|
|
];
|
|
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 设置表头样式
|
|
|
|
|
foreach ($headers as $cell => $value) {
|
|
|
|
|
$sheet->setCellValue($cell, $value);
|
|
|
|
|
}
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 设置表头样式
|
|
|
|
|
$headerStyle = [
|
|
|
|
|
'font' => [
|
|
|
|
|
'bold' => true,
|
|
|
|
|
'color' => ['rgb' => 'FFFFFF'],
|
|
|
|
|
],
|
|
|
|
|
'fill' => [
|
|
|
|
|
'fillType' => Fill::FILL_SOLID,
|
|
|
|
|
'startColor' => ['rgb' => '4472C4'],
|
|
|
|
|
],
|
|
|
|
|
'alignment' => [
|
|
|
|
|
'horizontal' => Alignment::HORIZONTAL_CENTER,
|
|
|
|
|
'vertical' => Alignment::VERTICAL_CENTER,
|
|
|
|
|
],
|
|
|
|
|
'borders' => [
|
|
|
|
|
'allBorders' => [
|
|
|
|
|
'borderStyle' => Border::BORDER_THIN,
|
|
|
|
|
'color' => ['rgb' => '000000'],
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
];
|
2025-08-04 11:17:38 +08:00
|
|
|
|
|
|
|
|
$sheet->getStyle('A1:K1')->applyFromArray($headerStyle);
|
|
|
|
|
|
|
|
|
|
// 填充数据
|
|
|
|
|
$row = 2;
|
|
|
|
|
foreach ($customers as $customer) {
|
|
|
|
|
// 获取完整的客户信息
|
|
|
|
|
$customerData = $this->getCustomer($customer);
|
|
|
|
|
|
|
|
|
|
// 填充数据行
|
|
|
|
|
$sheet->setCellValue('A' . $row, $customerData['id']);
|
|
|
|
|
$sheet->setCellValue('B' . $row, $customerData['contacts']);
|
|
|
|
|
$sheet->setCellValue('C' . $row, $customerData['phone']);
|
|
|
|
|
$sheet->setCellValue('D' . $row, $customerData['email']);
|
|
|
|
|
$sheet->setCellValue('E' . $row, $customerData['WhatsApp']);
|
|
|
|
|
$sheet->setCellValue('F' . $row, $customerData['sex_txt']);
|
|
|
|
|
$sheet->setCellValue('G' . $row, $customerData['country_name']);
|
|
|
|
|
$sheet->setCellValue('H' . $row, $customerData['channel_name']);
|
|
|
|
|
$sheet->setCellValue('I' . $row, $customerData['describe']);
|
|
|
|
|
$sheet->setCellValue('J' . $row, $customerData['user_name']); // 所属人姓名
|
|
|
|
|
$sheet->setCellValue('K' . $row, $customerData['enter_user_name']);
|
|
|
|
|
|
|
|
|
|
$row++;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 设置数据行样式
|
|
|
|
|
$dataStyle = [
|
|
|
|
|
'borders' => [
|
|
|
|
|
'allBorders' => [
|
|
|
|
|
'borderStyle' => Border::BORDER_THIN,
|
|
|
|
|
'color' => ['rgb' => '000000'],
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
'alignment' => [
|
|
|
|
|
'vertical' => Alignment::VERTICAL_CENTER,
|
|
|
|
|
],
|
|
|
|
|
];
|
2025-08-04 11:17:38 +08:00
|
|
|
|
|
|
|
|
$lastRow = $row - 1;
|
|
|
|
|
if ($lastRow >= 2) {
|
|
|
|
|
$sheet->getStyle('A2:K' . $lastRow)->applyFromArray($dataStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 自动调整列宽
|
|
|
|
|
foreach (range('A', 'K') as $column) {
|
|
|
|
|
$sheet->getColumnDimension($column)->setAutoSize(true);
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 设置行高
|
|
|
|
|
$sheet->getRowDimension(1)->setRowHeight(25);
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 生成文件名
|
|
|
|
|
$filename = '客户数据_' . date('Y-m-d_H-i-s') . '.xlsx';
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 创建输出目录
|
|
|
|
|
$exportDir = runtime_path() . '/export/';
|
|
|
|
|
if (!is_dir($exportDir)) {
|
|
|
|
|
mkdir($exportDir, 0755, true);
|
|
|
|
|
}
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
$filepath = $exportDir . $filename;
|
2025-08-04 11:17:38 +08:00
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
// 创建Excel写入器
|
|
|
|
|
$writer = new Xlsx($spreadsheet);
|
2025-08-05 15:37:26 +08:00
|
|
|
$writer->save($filepath);
|
|
|
|
|
// $writer->save('php://output');
|
|
|
|
|
// $excelContent = ob_get_clean();
|
|
|
|
|
// return $excelContent;
|
|
|
|
|
|
|
|
|
|
// 返回文件信息
|
|
|
|
|
return [
|
|
|
|
|
'filename' => $filename,
|
|
|
|
|
'filepath' => $filepath,
|
|
|
|
|
'size' => filesize($filepath),
|
|
|
|
|
'count' => count($customers)
|
|
|
|
|
];
|
2025-08-01 17:18:08 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-01 14:20:12 +08:00
|
|
|
/**
|
|
|
|
|
* @param $params
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2025-08-04 11:17:38 +08:00
|
|
|
public function audit($params)
|
|
|
|
|
{
|
2025-08-01 14:20:12 +08:00
|
|
|
|
|
|
|
|
$id = $params['id'];
|
|
|
|
|
|
|
|
|
|
$logic = new CustomerLogic();
|
2025-08-04 11:17:38 +08:00
|
|
|
if ($params['scene'] == 'delete') {
|
2025-08-01 17:18:08 +08:00
|
|
|
return $logic->forceDelete($params['id']);
|
2025-08-04 11:17:38 +08:00
|
|
|
} else {
|
2025-08-01 17:18:08 +08:00
|
|
|
return $logic->status($params['id'], 1);
|
2025-08-01 14:20:12 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
/**
|
|
|
|
|
* @param $params
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function transfer($params)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
Db::beginTransaction();
|
|
|
|
|
$customerId = $params['customer_id'];
|
|
|
|
|
$userId = $params['user_id'];
|
|
|
|
|
|
|
|
|
|
$query= Customer::whereIn('id',explode(',',$customerId));
|
|
|
|
|
$customer = $query->get();
|
|
|
|
|
|
|
|
|
|
foreach ($customer as $item) {
|
|
|
|
|
//记录客户关系变化
|
|
|
|
|
$his = CustomerHis::create([
|
|
|
|
|
'customer_id' => $item->id,
|
|
|
|
|
'user_his' => $item->user_id,
|
|
|
|
|
'user_id' => $userId,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
$res = $query->update(['user_id' => $userId]);
|
|
|
|
|
|
|
|
|
|
Db::commit();
|
|
|
|
|
return $res;
|
|
|
|
|
} catch (\Throwable $e) {
|
|
|
|
|
Db::rollback();
|
|
|
|
|
throw $e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 14:20:12 +08:00
|
|
|
/**
|
|
|
|
|
* @param $customer
|
|
|
|
|
* @param $request
|
|
|
|
|
* @param $tag 是否返回客户标签
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
public static function getCustomer($customer, $language = 'zh_CN', $tag = false)
|
|
|
|
|
{
|
|
|
|
|
$customer['grade_txt'] = Util::language($language, Constants::GRADE_EN[$customer['grade']], Constants::GRADE_ZH[$customer['grade']], Constants::GRADE_RU[$customer['grade']]);
|
2025-08-05 14:03:06 +08:00
|
|
|
$customer['magnitude'] = ($customer['magnitude']==0)?1:$customer['magnitude'];
|
2025-08-01 14:20:12 +08:00
|
|
|
$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']]);
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
if ($customer['grade'] <= 2) {
|
2025-08-01 14:20:12 +08:00
|
|
|
$customer['follow'] = 0;
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer['follow_txt'] = Util::language($language, 'Following', '跟进中', 'Продолжение');
|
|
|
|
|
} elseif ($customer['grade'] < 5) {
|
2025-08-01 14:20:12 +08:00
|
|
|
$customer['follow'] = 1;
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer['follow_txt'] = Util::language($language, 'transacted', '已成交', 'Транзакция завершена');
|
|
|
|
|
} else {
|
2025-08-01 14:20:12 +08:00
|
|
|
$customer['follow'] = 2;
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer['follow_txt'] = Util::language($language, 'lost', '已流失', 'Потерянный');
|
2025-08-01 14:20:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$where = [
|
|
|
|
|
'customer_id' => $customer['id']
|
|
|
|
|
];
|
2025-08-04 11:17:38 +08:00
|
|
|
$begin_follow = Follow::select('id', 'created_at', 'updated_at')
|
2025-08-01 14:20:12 +08:00
|
|
|
->where($where)
|
|
|
|
|
->min('created_at');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$customer['begin_follow'] = Util::timeTotDate($begin_follow);
|
|
|
|
|
// $customer['created_at'] = Util::timeTotDate($customer['created_at']);
|
|
|
|
|
// $customer['updated_at'] = Util::timeTotDate($customer['updated_at']);
|
|
|
|
|
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer = Util::formatDate($customer, ['follow_last']);
|
|
|
|
|
$nameLang = $language == 'en' ? 'name_en' : ($language == 'ru' ? 'name_ru' : 'name');
|
|
|
|
|
$countryLang = $language == 'en' ? 'en_addr' : 'cn_addr';
|
2025-08-01 14:20:12 +08:00
|
|
|
// $customer['car_type_name'] = empty($customer['car_type_id'])?'':CarType::where(['id'=>$customer['car_type_id']])->value($nameLang);
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer['country_name'] = empty($customer['country_id']) ? '' : Country::where(['id' => $customer['country_id']])->value($countryLang);
|
|
|
|
|
$customer['channel_name'] = empty($customer['channel_id']) ? '' : Channel::where(['id' => $customer['channel_id']])->value($nameLang);
|
2025-08-01 14:20:12 +08:00
|
|
|
// $customer['last_follow'] = $last_follow;
|
|
|
|
|
|
|
|
|
|
if ($tag) {
|
|
|
|
|
foreach ($customer['tags'] as &$tag) {
|
|
|
|
|
$tag['names'] = unserialize($tag['names']);
|
|
|
|
|
$tag['name'] = $tag['names'][$language];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-05 15:29:31 +08:00
|
|
|
|
|
|
|
|
$customer['enter_user_name'] = empty($customer['enter_user_id']) ? '' : User::where('id',$customer['enter_user_id'])->value('name');
|
|
|
|
|
$customer['user_name'] = empty($customer['user_id']) ? '公海' : User::where('id',$customer['user_id'])->value('name');
|
2025-08-01 14:20:12 +08:00
|
|
|
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function detail($params)
|
|
|
|
|
{
|
2025-08-04 11:17:38 +08:00
|
|
|
$id = $params['id'];
|
|
|
|
|
$customer = Customer::with('tags')
|
2025-08-01 14:20:12 +08:00
|
|
|
->where('id', $id)
|
|
|
|
|
->first();
|
2025-08-04 11:17:38 +08:00
|
|
|
$customer = $this->getCustomer($customer);
|
2025-08-01 14:20:12 +08:00
|
|
|
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
}
|