input('id'); $prefix = Storage::disk('public')->url(''); $detail = Special::query() ->select(['id', 'picture', 'updated_at', 'agent_product_id']) ->find($id); $detail->picture = array_map(fn($v) => $prefix . $v, $detail->picture); $detail->product = AgentProduct::list() ->where('agent_id', $this->agent_id) ->whereIn('id', $detail->agent_product_id) ->orderBy('id', 'DESC')->limit(6)->get(); foreach ($detail->product as $k => &$v) { $v->pictures = array_map(fn($item) => $prefix . $item, $v->pictures); } unset($detail->agent_product_id); return $this->success($detail); } }