master
wangxinglong 2022-03-16 10:52:12 +08:00
parent bcfd6e0cbe
commit 44015427e6
1 changed files with 3 additions and 5 deletions

View File

@ -365,8 +365,6 @@ class Coupon extends Base
$couponMain->save(["received_count"=>Db::raw("received_count + 1")]);
//是否开启分销 并且有分销人 给分销人发红包
if($couponMain->is_distribution == CouponMain::COMMON_ON && !empty($distributionUserCode))
{
@ -392,7 +390,7 @@ class Coupon extends Base
'openid' => $distributionUser->open_id,
'check_name' => 'NO_CHECK',// NO_CHECK不校验真实姓名, FORCE_CHECK强校验真实姓名
'amount' => $amount * 100, //单位为分不小于100
'desc' => '优惠券分销,分销者领取奖励',
'desc' => '优惠券分销奖励',
];
// 写入红包
@ -715,7 +713,7 @@ class Coupon extends Base
$agencyRedpackData['pay_time'] = date("Y-m-d H:i:s",$time);
}else{
//否则失败 记录失败原因
Log::info("企业发起付款【渠道商】失败:" . json_encode($agencyResult,JSON_UNESCAPED_UNICODE));
Log::info("企业发起付款【渠道商红包】失败:" . json_encode($agencyResult,JSON_UNESCAPED_UNICODE));
}
// 不管成功还是失败 都要写入
Redpack::create($agencyRedpackData);
@ -788,7 +786,7 @@ class Coupon extends Base
]);
}
//否则失败 记录失败原因
Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
Log::info("企业发起付款【消费者红包】失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
//默认回滚
Db::rollback();
//失败也要写入红包记录