lszyh
zengyyh 4 months ago
parent c6dfff7c82
commit c5d3709d73
  1. 2
      app/admin/controller/Wxserve.php
  2. 22
      app/api/controller/Order.php
  3. 18
      app/store/controller/Order.php

@ -332,7 +332,7 @@ class Wxserve extends Controller
if ($appid) { if ($appid) {
$obj = new Server(); $obj = new Server();
$msg = $obj->applySetOrderPathInfo([$appid]); $msg = $obj->applySetOrderPathInfo([$appid]);
if ($msg['errmsg'] == 'ok') { if ($msg == 'ok') {
return $this->renderSuccess('success'); return $this->renderSuccess('success');
} }
} }

@ -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);
$merchant = $MerchantRemarks->orderRemarkList($orderId);
if ($merchant) {
foreach ($merchant as $key => $value) { foreach ($merchant as $key => $value) {
if (isset($value['image_id'])) { // 初始化 $image_id 为 null 或者一个默认值
// 解码 JSON 字符串并确保返回的是数组 $image_id = null;
$decodedImageId = json_decode($value['image_id'], true);
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']);
} }
} }
} }

@ -121,12 +121,24 @@ class Order extends Controller
$merchant = $MerchantRemarks->orderRemarkList($orderId); $merchant = $MerchantRemarks->orderRemarkList($orderId);
if ($merchant) { if ($merchant) {
foreach ($merchant as $key => $value) { foreach ($merchant as $key => $value) {
if(isset($value['image_id']) && !empty($value['image_id'])) // 初始化 $image_id 为 null 或者一个默认值
$image_id = json_decode($value['image_id'],true); $image_id = null;
$item['image_id'] = $image_id['image_id'];
if (isset($value['image_id']) && !empty($value['image_id'])) {
$decoded_image_id = json_decode($value['image_id'], true);
// 检查 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']); $value['image_url'] = $MerchantRemarks->getRemarkImage($item['image_id']);
} }
} }
}
$detail['merchant'] = $merchant; $detail['merchant'] = $merchant;
return $this->renderSuccess(compact('detail')); return $this->renderSuccess(compact('detail'));
} }

Loading…
Cancel
Save