|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
namespace App\Service\v3\Implementations; |
|
|
namespace App\Service\v3\Implementations; |
|
|
|
|
|
|
|
|
|
|
|
use App\Model\v3\Order; |
|
|
use App\Model\v3\OrderMain; |
|
|
use App\Model\v3\OrderMain; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
use App\Service\v3\Interfaces\OrderOnlineServiceInterface; |
|
|
use App\Service\v3\Interfaces\OrderOnlineServiceInterface; |
|
|
@ -23,11 +24,16 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
|
|
|
|
|
public function detailByUser($orderMainId, $userId) |
|
|
public function detailByUser($orderMainId, $userId) |
|
|
{ |
|
|
{ |
|
|
return OrderMain::query() |
|
|
|
|
|
->where(['id' => $orderMainId]) |
|
|
|
|
|
->with(['orders' => function($query) { |
|
|
|
|
|
return $query->with(['orderGoods']); |
|
|
|
|
|
}]) |
|
|
|
|
|
->first()->toArray(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$orderMain = OrderMain::with(['market'])->find($orderMainId); |
|
|
|
|
|
$orders = Order::query() |
|
|
|
|
|
->where(['order_main_id' => $orderMainId, 'user_id' => $userId]) |
|
|
|
|
|
->with([ |
|
|
|
|
|
'orderGoods', |
|
|
|
|
|
'store' |
|
|
|
|
|
]) |
|
|
|
|
|
->get()->toArray(); |
|
|
|
|
|
|
|
|
|
|
|
return ['order_main' => $orderMain, 'orders' => $orders]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |