setter
parent
fcd20b81b6
commit
c532c5731e
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue