diff --git a/app/Model/v3/OrderMain.php b/app/Model/v3/OrderMain.php index c3abfc8..3e2c185 100644 --- a/app/Model/v3/OrderMain.php +++ b/app/Model/v3/OrderMain.php @@ -91,6 +91,15 @@ class OrderMain extends Model return Shipping::getMessage($this->attributes['shipping_type']); } + public function getNoteAttribute($value) + { + if ($this->attributes['refuse_refund_note'] || $this->attributes['total_refund_note']) { + return $this->attributes['refuse_refund_note'] ?: $this->attributes['total_refund_note']; + } + + return $value; + } + public function market() { return $this->belongsTo(Market::class, 'market_id', 'id'); diff --git a/app/Service/v3/Implementations/OrderListService.php b/app/Service/v3/Implementations/OrderListService.php index db7f6c7..99bae87 100644 --- a/app/Service/v3/Implementations/OrderListService.php +++ b/app/Service/v3/Implementations/OrderListService.php @@ -161,7 +161,8 @@ class OrderListService implements OrderListServiceInterface ->with(['orders' => function($query) { $query->with('store'); }]) - ->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]); + ->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]) + ->whereIn('state', [OrderState::PAID,OrderState::DELIVERY,OrderState::COMPLETED]); $paginate = $builder->orderBy('created_at', 'desc')->paginate($pagesize); $orders = $paginate->toArray();