diff --git a/app/Model/v3/GoodsActivity.php b/app/Model/v3/GoodsActivity.php index 7ff6a34..e6b6887 100644 --- a/app/Model/v3/GoodsActivity.php +++ b/app/Model/v3/GoodsActivity.php @@ -44,6 +44,7 @@ class GoodsActivity extends Model 'is_effective', 'noneffective_note', 'total_seconds', + 'details_imgs_url', ]; // protected $visible = [ @@ -101,4 +102,13 @@ class GoodsActivity extends Model return $this->morphMany(ShoppingCart::class, 'goods'); } + public function getDetailsImgsUrlAttribute() + { + $details_imgs = $this->details_imgs; + $img_host = config('alioss.img_host').'/'; + + return collect($details_imgs)->map(function($item) use ($img_host){ + return $img_host . $item; + }); + } } \ No newline at end of file diff --git a/app/Model/v3/GoodsActivityBanner.php b/app/Model/v3/GoodsActivityBanner.php index 144be84..8555f3e 100644 --- a/app/Model/v3/GoodsActivityBanner.php +++ b/app/Model/v3/GoodsActivityBanner.php @@ -11,6 +11,10 @@ class GoodsActivityBanner extends Model use SoftDeletes; protected $table = 'lanzu_goods_activity_banners'; + protected $appends = [ + 'banner_url', + ]; + public function getBannerUrlAttribute() { 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();