diff --git a/app/store/controller/Store.php b/app/store/controller/Store.php index 87eab76a..e4d2952c 100644 --- a/app/store/controller/Store.php +++ b/app/store/controller/Store.php @@ -60,6 +60,23 @@ class Store extends Controller $list = StoreSettle::where('store_id', '=', $this->storeId) ->order('created_at','desc') ->paginate(10); + foreach ($list as $item) { + $idCard = $item['identification_photo']; + $businessCare = $item['business_license']; + if (empty($idCard)) { + $item['idCardUrl'] = null; + } else { + $idCard = explode(",", $idCard); + $item['idCardUrl'] = UploadFileModel::withoutGlobalScope()->where('file_id', 'in' , $idCard)->select(); // 或者选择特定字段 + } + + if (empty($businessCare)) { + $item['businessCareUrl'] = null; + } else { + $businessCareArray = explode(',', $businessCare); + $item['businessCareUrl'] = UploadFileModel::withoutGlobalScope()->whereIn('file_id', $businessCareArray)->select(); + } + } return $this->renderSuccess(compact('list')); } @@ -69,6 +86,21 @@ class Store extends Controller public function settleDetail(int $id): Json { $detail = StoreSettle::get($id); + $idCard = $detail['identification_photo']; + $businessCare = $detail['business_license']; + if (empty($idCard)) { + $detail['idCardUrl'] = null; + } else { + $idCard = explode(",", $idCard); + $detail['idCardUrl'] = UploadFileModel::withoutGlobalScope()->where('file_id', 'in' , $idCard)->select(); // 或者选择特定字段 + } + + if (empty($businessCare)) { + $detail['businessCareUrl'] = null; + } else { + $businessCareArray = explode(',', $businessCare); + $detail['businessCareUrl'] = UploadFileModel::withoutGlobalScope()->whereIn('file_id', $businessCareArray)->select(); + } return $this->renderSuccess(compact('detail')); } /**