From b19c5d47ab64c7e591640e1b7659a4220c7818c2 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Thu, 9 Nov 2023 09:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA=E8=8D=AF?= =?UTF-8?q?=E5=93=81=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/Coupon.php | 5 ----- app/Services/PatientOrderService.php | 2 +- app/Services/UserCouponService.php | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Model/Coupon.php b/app/Model/Coupon.php index 7863a30..f7d18ca 100644 --- a/app/Model/Coupon.php +++ b/app/Model/Coupon.php @@ -54,11 +54,6 @@ class Coupon extends Model */ protected array $fillable = ['coupon_id', 'coupon_name', 'coupon_icon', 'coupon_client', 'coupon_type', 'coupon_status', 'distribution_object', 'application_scope', 'inquiry_type', 'brand_id', 'is_mutex', 'is_display', 'distribution_with_day', 'min_usable_number', 'coupon_count', 'coupon_take_count', 'coupon_used_count', 'coupon_price', 'with_amount', 'valid_type', 'valid_days', 'valid_start_time', 'valid_end_time', 'product_id', 'reissue_interval_days', 'is_reissuable_after_expire', 'is_popup', 'created_at', 'updated_at']; - /** - * The attributes that should be cast to native types. - */ - protected array $casts = ['coupon_id' => 'string', 'coupon_client' => 'integer', 'coupon_type' => 'integer', 'coupon_status' => 'integer', 'distribution_object' => 'integer', 'application_scope' => 'integer', 'is_display' => 'integer', 'distribution_with_day' => 'integer', 'coupon_count' => 'integer', 'coupon_take_count' => 'integer', 'coupon_used_count' => 'integer', 'valid_type' => 'integer', 'valid_days' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'is_mutex' => 'integer', 'brand_id' => 'integer', 'min_usable_number' => 'integer', 'reissue_interval_days' => 'integer', 'is_reissuable_after_expire' => 'integer', 'is_popup' => 'integer', 'inquiry_type' => 'integer']; - protected string $primaryKey = "coupon_id"; /** diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 060627f..0798463 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -1170,7 +1170,7 @@ class PatientOrderService extends BaseService // 优惠卷商品数据 $coupon_product_data = array(); $product['product_num'] = $order_prescription_product['prescription_product_num']; - $coupon_product_data[] = $product; + $coupon_product_data = $product->toArray(); $coupon_product_datas[] = $coupon_product_data; } diff --git a/app/Services/UserCouponService.php b/app/Services/UserCouponService.php index ee077cb..53216ea 100644 --- a/app/Services/UserCouponService.php +++ b/app/Services/UserCouponService.php @@ -133,6 +133,7 @@ class UserCouponService extends BaseService $coupons[$key]['cannot_use_coupon_reason'] = ""; // 不可使用原因 } + dump($user_coupons); foreach ($coupons as $key => $coupon) { // 处理优惠卷数量限制问题 if ($coupon['coupon_type'] == 3 && !empty($coupon['product_id'])){