|
@@ -113,6 +113,31 @@ class BodyProfile extends Model
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 获取身体照片数组(带CDN处理)
|
|
|
|
+ */
|
|
|
|
+ public function getBodyPhotosAttr($value, $data)
|
|
|
|
+ {
|
|
|
|
+ if (empty($data['body_photos'])) {
|
|
|
|
+ return [
|
|
|
|
+ 'front' => '',
|
|
|
|
+ 'side' => '',
|
|
|
|
+ 'back' => ''
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $photos = json_decode($data['body_photos'], true);
|
|
|
|
+ if (is_array($photos)) {
|
|
|
|
+ foreach ($photos as $key => &$photo) {
|
|
|
|
+ if (!empty($photo)) {
|
|
|
|
+ $photo = cdnurl($photo, true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $photos;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 设置身体照片
|
|
* 设置身体照片
|
|
*/
|
|
*/
|
|
public function setBodyPhotosAttr($value)
|
|
public function setBodyPhotosAttr($value)
|
|
@@ -138,7 +163,7 @@ class BodyProfile extends Model
|
|
$profile['body_types'][$selection['type_category']] = [
|
|
$profile['body_types'][$selection['type_category']] = [
|
|
'type_id' => $selection['selected_type_id'],
|
|
'type_id' => $selection['selected_type_id'],
|
|
'type_name' => $selection->typeConfig ? $selection->typeConfig['type_name'] : '',
|
|
'type_name' => $selection->typeConfig ? $selection->typeConfig['type_name'] : '',
|
|
- 'type_image' => $selection->typeConfig ? $selection->typeConfig['type_image'] : ''
|
|
|
|
|
|
+ 'type_image' => $selection->typeConfig ? cdnurl($selection->typeConfig['type_image'], true) : ''
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|