From a15850f10a2c00627fdbf9dd9a2d6aca200fc1f2 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Fri, 11 Sep 2020 14:24:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=89=B9=E4=BB=B7=E5=95=86=E5=93=81BANNER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/GoodsActivityBanner.php | 4 ++++ 1 file changed, 4 insertions(+) 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() { From 2b0bab249140ff568084576d56b09785bfb8b27d Mon Sep 17 00:00:00 2001 From: weigang Date: Fri, 11 Sep 2020 15:28:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BD=93=E9=9D=A2?= =?UTF-8?q?=E4=BB=98=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=EF=BC=8C=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/OrderMain.php | 9 +++++++++ app/Service/v3/Implementations/OrderListService.php | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) 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(); From f74fd49a8932c8c5ca912f9aae7fa3cc32261243 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Fri, 11 Sep 2020 15:41:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=9B=BE=20=E6=8B=BCurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/GoodsActivity.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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