|
@@ -99,7 +99,7 @@ class AccountService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 提���技师资质信息
|
|
|
+ * 提交技师资质信息
|
|
|
* 包括资质证书照片、营业执照和健康证照片的提交和审核
|
|
|
*
|
|
|
* 业务流程:
|
|
@@ -213,6 +213,9 @@ class AccountService
|
|
|
// 创建新的实名认证记录,设置为待审核状态
|
|
|
$user->coach->realRecords()->create(array_merge($data, [
|
|
|
'state' => TechnicianAuthStatus::AUDITING->value,
|
|
|
+ 'id_card_front_photo' => json_encode($data['id_card_front_photo']),
|
|
|
+ 'id_card_back_photo' => json_encode($data['id_card_back_photo']),
|
|
|
+ 'id_card_hand_photo' => json_encode($data['id_card_hand_photo']),
|
|
|
]));
|
|
|
|
|
|
// 清除技师信息缓存,确保数据一致性
|
|
@@ -258,14 +261,15 @@ class AccountService
|
|
|
abort_if(!$user->coach, 404, '技师信息不存在');
|
|
|
|
|
|
// 尝试从缓存获取数据
|
|
|
- return Cache::remember(
|
|
|
- self::CACHE_KEY_PREFIX . $user->coach->id,
|
|
|
- self::CACHE_TTL,
|
|
|
- function () use ($user) {
|
|
|
- // 缓存不存在时,从数据库获取
|
|
|
- return $this->fetchCoachInfo($user->coach);
|
|
|
- }
|
|
|
- );
|
|
|
+ // return Cache::remember(
|
|
|
+ // self::CACHE_KEY_PREFIX . $user->coach->id,
|
|
|
+ // self::CACHE_TTL,
|
|
|
+ // function () use ($user) {
|
|
|
+ // // 缓存不存在时,从数据库获取
|
|
|
+ // return $this->fetchCoachInfo($user->coach);
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ return $this->fetchCoachInfo($user->coach);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -537,9 +541,9 @@ class AccountService
|
|
|
return [
|
|
|
'qual_type' => $qual->qual_type,
|
|
|
'qual_type_text' => $qualTypeMap[$qual->qual_type] ?? '未知类型',
|
|
|
- 'qual_photo' => $qual->qual_photo,
|
|
|
- 'business_license' => $qual->business_license,
|
|
|
- 'health_cert' => $qual->health_cert,
|
|
|
+ 'qual_photo' => json_decode($qual->qual_photo, true),
|
|
|
+ 'business_license' => json_decode($qual->business_license, true),
|
|
|
+ 'health_cert' => json_decode($qual->health_cert, true),
|
|
|
'state' => $qual->state,
|
|
|
'state_text' => $qual->state ? TechnicianAuthStatus::fromValue($qual->state)->label() : null,
|
|
|
'audit_remark' => $qual->audit_remark,
|
|
@@ -560,13 +564,13 @@ class AccountService
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- // 返回格式��后的实名信息,包含状态文本和脱敏处理
|
|
|
+ // 返回格式化后的实名信息,包含状态文本和脱敏处理
|
|
|
return [
|
|
|
'real_name' => $real->real_name,
|
|
|
'id_card' => $this->maskIdCard($real->id_card),
|
|
|
- 'id_card_front_photo' => $real->id_card_front_photo,
|
|
|
- 'id_card_back_photo' => $real->id_card_back_photo,
|
|
|
- 'id_card_hand_photo' => $real->id_card_hand_photo,
|
|
|
+ 'id_card_front_photo' => $real->id_card_front_photo ? json_decode($real->id_card_front_photo, true) : null,
|
|
|
+ 'id_card_back_photo' => $real->id_card_back_photo ? json_decode($real->id_card_back_photo, true) : null,
|
|
|
+ 'id_card_hand_photo' => $real->id_card_hand_photo ? json_decode($real->id_card_hand_photo, true) : null,
|
|
|
'state' => $real->state,
|
|
|
'state_text' => $real->state ? TechnicianAuthStatus::fromValue($real->state)->label() : null,
|
|
|
'audit_remark' => $real->audit_remark,
|
|
@@ -714,7 +718,7 @@ class AccountService
|
|
|
* 格式化位置响应数据
|
|
|
*
|
|
|
* @param CoachLocation $location 位置记录
|
|
|
- * @return array 格式化后���位置信息,包含:
|
|
|
+ * @return array 格式化后的位置信息,包含:
|
|
|
* - province: string 省份
|
|
|
* - city: string 城市
|
|
|
* - district: string 区县
|
|
@@ -785,7 +789,7 @@ class AccountService
|
|
|
// 验证时间段数组
|
|
|
abort_if(empty($timeRanges), 400, '必须至少设置一个时间段');
|
|
|
|
|
|
- // 验证每个时间段格式并转换为分钟���进行比较
|
|
|
+ // 验证每个时间段格式并转换为分钟数进行比较
|
|
|
$ranges = collect($timeRanges)->map(function ($range) {
|
|
|
abort_if(
|
|
|
!isset($range['start_time'], $range['end_time']),
|
|
@@ -1168,7 +1172,7 @@ class AccountService
|
|
|
*/
|
|
|
private function getLatestBaseInfo(CoachUser $coach): CoachInfoRecord
|
|
|
{
|
|
|
- // 获取最新的��师信息记录(排除审核拒绝的记录)
|
|
|
+ // 获取最新的技师信息记录(排除审核拒绝的记录)
|
|
|
$latestInfo = $coach->infoRecords()
|
|
|
->where('state', '<>', TechnicianAuthStatus::REJECTED->value)
|
|
|
->latest()
|