feat : user
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
namespace App\Service\Api\Order;
|
||||
|
||||
use App\Model\Order;
|
||||
use App\Model\OrderGood;
|
||||
use App\Service\Api\BaseService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
@@ -22,6 +23,12 @@ class OrderListService extends BaseService
|
||||
#[Inject]
|
||||
protected Order $orderModel;
|
||||
|
||||
/**
|
||||
* @var OrderGood
|
||||
*/
|
||||
#[Inject]
|
||||
protected OrderGood $orderGoodModel;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$limit = $this->request->input('limit', 20);
|
||||
@@ -38,10 +45,16 @@ class OrderListService extends BaseService
|
||||
if (!empty($orderList['data'])) {
|
||||
$this->buildData($orderList['data']);
|
||||
}
|
||||
|
||||
return $this->return->success('success', ['list' => $orderList]);
|
||||
}
|
||||
|
||||
private function buildData(array &$orderList)
|
||||
{
|
||||
$orderIds = array_column($orderList, 'id');
|
||||
|
||||
$skuId = $this->orderGoodModel->whereIn('order_id', $orderIds)->pluck('sku_id')->toArray();
|
||||
|
||||
// foreach ($orderList as &$order) {
|
||||
//
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user