Browse Source

用户当面付订单列表,订单备注

master
weigang 5 years ago
parent
commit
2b0bab2491
  1. 9
      app/Model/v3/OrderMain.php
  2. 3
      app/Service/v3/Implementations/OrderListService.php

9
app/Model/v3/OrderMain.php

@ -91,6 +91,15 @@ class OrderMain extends Model
return Shipping::getMessage($this->attributes['shipping_type']); 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() public function market()
{ {
return $this->belongsTo(Market::class, 'market_id', 'id'); return $this->belongsTo(Market::class, 'market_id', 'id');

3
app/Service/v3/Implementations/OrderListService.php

@ -161,7 +161,8 @@ class OrderListService implements OrderListServiceInterface
->with(['orders' => function($query) { ->with(['orders' => function($query) {
$query->with('store'); $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); $paginate = $builder->orderBy('created_at', 'desc')->paginate($pagesize);
$orders = $paginate->toArray(); $orders = $paginate->toArray();

Loading…
Cancel
Save