|
|
@ -82,14 +82,24 @@ class Order extends Controller |
|
|
|
$model = OrderModel::getUserOrderDetail($orderId); |
|
|
|
$model = OrderModel::getUserOrderDetail($orderId); |
|
|
|
$MerchantRemarks = new MerchantRemarksModel; |
|
|
|
$MerchantRemarks = new MerchantRemarksModel; |
|
|
|
$merchant = $MerchantRemarks->orderRemarkList($orderId); |
|
|
|
$merchant = $MerchantRemarks->orderRemarkList($orderId); |
|
|
|
foreach ($merchant as $key => $value) { |
|
|
|
$merchant = $MerchantRemarks->orderRemarkList($orderId); |
|
|
|
if (isset($value['image_id'])) { |
|
|
|
if ($merchant) { |
|
|
|
// 解码 JSON 字符串并确保返回的是数组 |
|
|
|
foreach ($merchant as $key => $value) { |
|
|
|
$decodedImageId = json_decode($value['image_id'], true); |
|
|
|
// 初始化 $image_id 为 null 或者一个默认值 |
|
|
|
|
|
|
|
$image_id = null; |
|
|
|
|
|
|
|
|
|
|
|
if (is_array($decodedImageId) && isset($decodedImageId['image_id'])) { |
|
|
|
if (isset($value['image_id']) && !empty($value['image_id'])) { |
|
|
|
$value['image_id'] = $decodedImageId['image_id']; |
|
|
|
$decoded_image_id = json_decode($value['image_id'], true); |
|
|
|
$value['image_url'] = UploadFile::getFileList($value['image_id']); |
|
|
|
|
|
|
|
|
|
|
|
// 检查 json_decode 是否成功并且结果中存在 'image_id' 键 |
|
|
|
|
|
|
|
if (is_array($decoded_image_id) && isset($decoded_image_id['image_id'])) { |
|
|
|
|
|
|
|
$image_id = $decoded_image_id['image_id']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($image_id !== null) { // 确保 $image_id 已经被设置 |
|
|
|
|
|
|
|
$item['image_id'] = $image_id; |
|
|
|
|
|
|
|
$value['image_url'] = $MerchantRemarks->getRemarkImage($item['image_id']); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|