pull/1/head
wanghousheng 10 months ago
parent bc89399931
commit 250569828a
  1. 13
      app/api/controller/Recovery.php
  2. 2
      app/common/model/RecoveryOrder.php

@ -45,11 +45,11 @@ class Recovery extends Controller
/**
* @notes:获取详情
* @return Json|void
* @return Json
* @throws BaseException
* @author: wanghousheng
*/
public function detail()
public function detail(): Json
{
$recoveryId = intval($this->request->post('recovery_id'));
if (!$recoveryId) {
@ -57,6 +57,15 @@ class Recovery extends Controller
}
$model = new RecoveryOrder();
$info = $model->getDetails($recoveryId);
if ($info && !empty($info['images'])) {
$images_list = helper::getArrayColumn($info['images'], 'file');
$arr = [];
foreach ($images_list as $image) {
$arr[] = $image['preview_url'];
}
$info['images_list'] = $arr;
unset($info['images']);
}
return $this->renderSuccess(['detail' => $info]);
}

@ -30,7 +30,7 @@ class RecoveryOrder extends BaseModel
*/
public function images(): HasMany
{
return $this->hasMany('RecoveryImage')->order(['id']);
return $this->hasMany(RecoveryImage::class, 'recovery_id', 'recovery_id')->order(['id']);
}
public function getOrderStatusTextAttr($value, $data)

Loading…
Cancel
Save