|
@@ -7,7 +7,6 @@ use App\Models\Order\Order;
|
|
|
use App\Models\Order\OrderGoods;
|
|
|
use App\Models\User\User;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
-use Illuminate\Support\Arr;
|
|
|
|
|
|
class OrderService extends BaseService
|
|
|
{
|
|
@@ -39,6 +38,18 @@ class OrderService extends BaseService
|
|
|
"thumb" => $firstGoods->goods->thumb,
|
|
|
"email" => $model->user->email,
|
|
|
"created_at" => $model->created_at->format("Y-m-d H:i:s"),
|
|
|
+ "goods" => $model->goods->map(function (OrderGoods $goods) {
|
|
|
+ return [
|
|
|
+ "goods_id" => $goods->id,
|
|
|
+ "goods_name" => $goods->goods->name,
|
|
|
+ "goods_thumb" => $goods->goods->thumb,
|
|
|
+ "goods_sn" => $goods->sn,
|
|
|
+ "goods_count" => $goods->count,
|
|
|
+ ];
|
|
|
+ }),
|
|
|
+ "phone" => $model->user->phone,
|
|
|
+ "name" => $model->user->name,
|
|
|
+ "source" => $model->source,
|
|
|
];
|
|
|
}, $p->items()),
|
|
|
];
|