From c532c5731ea707997a8d0718b9df9a8096593d76 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Tue, 15 Mar 2022 15:55:44 +0800 Subject: [PATCH] setter --- app/controller/api/Coupon.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index 4d25c68..e8cf316 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -338,7 +338,7 @@ class Coupon extends Base //写入领取记录 $data = [ "coupon_id" =>$couponMain->id, - "name" =>$couponMain->name, + "name" =>$couponMain["name"], "type_id" =>$couponMain->type, "type_name" =>$couponMain->type_name, "business_code" =>$couponMain->business_code, @@ -359,6 +359,9 @@ class Coupon extends Base CouponRepository::getInstance()->receiveCoupon($data); $couponMain->save(["received_count"=>Db::raw("received_count + 1")]); + + + //是否开启分销 并且有分销人 给分销人发红包 if($couponMain->is_distribution == CouponMain::COMMON_ON && !empty($distributionUserCode)) { @@ -384,7 +387,7 @@ class Coupon extends Base 'openid' => $account->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 'amount' => $amount * 100, //单位为分,不小于100 - 'desc' => '验证优惠券分销,分销者领取', + 'desc' => '优惠券分销,分销者领取奖励', ]; // 写入红包 @@ -421,7 +424,7 @@ class Coupon extends Base Db::rollback(); //失败也要写入红包记录 Redpack::create($redpackData); - return $this->json(5003, "验证失败,发放红包失败"); + return $this->json(5003, "领取失败,发放分享者红包失败"); } Db::commit();