From aa7d3eeb08a9e324e4b68cdf99c2c992f9f3a0d5 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Thu, 2 Jun 2022 10:07:28 +0800 Subject: [PATCH] setter --- app/controller/api/User.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controller/api/User.php b/app/controller/api/User.php index 1258b88..61b7591 100644 --- a/app/controller/api/User.php +++ b/app/controller/api/User.php @@ -1003,8 +1003,9 @@ class User extends Base $domain = $this->request->domain(); $res = OrderRepository::getInstance()->mine($userId, $tag, $page, $size); - $res['list'] = $res['list']->each(function ($item) use ($domain) { - $item->skus->each(function ($sku) use ($domain) { + $orderStatusTextList = OrderRepository::getInstance()->orderStatusTextList(); + $res['list'] = $res['list']->each(function ($item) use ($domain,$orderStatusTextList) { + $item->skus->each(function ($sku) use ($domain,$orderStatusTextList) { if (!$sku->spec_text) { $sku->spec_text = []; $sku->spec_info = []; @@ -1013,9 +1014,11 @@ class User extends Base $sku->spec_text = $specArr; $sku->spec_info = SpuRepository::getInstance()->convertSpecInfo($specArr); } - $sku->spu_cover = resourceJoin($sku->spu_cover, $domain); - $sku->sku_cover = resourceJoin($sku->sku_cover, $domain); + $sku->spu_cover = resourceJoin($sku->spu_cover, $domain); + $sku->sku_cover = resourceJoin($sku->sku_cover, $domain); + }); + $item->status_text = $orderStatusTextList[$item["status"]]; }); return $this->json(0, 'success', $res); }