From 55296574a96206466c2dd8fb034f690ab72f8e75 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Wed, 16 Mar 2022 15:57:02 +0800 Subject: [PATCH] setter --- app/controller/api/Coupon.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index 4ff5552..277f589 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -423,7 +423,7 @@ class Coupon extends Base 'partner_trade_no' => $mch_billno,// 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) 'openid' => $distributionUser->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 - 'amount' => $amount * 100, //单位为分,不小于100 + 'amount' => $amount * 100, //单位为分,不小于300 'desc' => '优惠券分销奖励', ]; @@ -433,7 +433,7 @@ class Coupon extends Base "mch_billno" => $mch_billno, "openid" => $distributionUser->open_id, "user_code" => $distributionUser->user_code, - "money" => $amount, + "money" => $amount * 100, //单位为分,不小于300 "create_time" => date("Y-m-d H:i:s",$time), "pay_time" => '0000-00-00 00:00:00', @@ -632,7 +632,6 @@ class Coupon extends Base $agencyMoney = 0; //四舍五入 精确到分 } - //开始数据操作 Db::startTrans(); try { @@ -728,12 +727,13 @@ class Coupon extends Base $mch_billno = createUuid(); } + $agencyAmount = $agencyMoney * 100 ; $agencyToBalanceData = [ 'partner_trade_no' => $mch_billno,// 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) 'openid' => $agencyUser->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 - 'amount' => $agencyMoney * 100, //单位为分,不小于100 + 'amount' => $agencyAmount , //单位为分,不小于300 'desc' => '用户核销优惠券,渠道商奖励', ]; @@ -743,7 +743,7 @@ class Coupon extends Base "mch_billno" => $mch_billno, "openid" => $agencyUser->open_id, "user_code" => $agencyUser->user_code, - "money" => $agencyMoney, + "money" => $agencyAmount, //单位为分,不小于300 "create_time" => date("Y-m-d H:i:s",$time), "pay_time" => '0000-00-00 00:00:00', @@ -768,9 +768,6 @@ class Coupon extends Base } // 不管成功还是失败 都要写入 Redpack::create($agencyRedpackData); - Db::rollback(); - return $this->json(4001,"agencyMoney{$agencyMoney}"); - } } } @@ -805,7 +802,7 @@ class Coupon extends Base 'partner_trade_no' => $mch_billno,// 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) 'openid' => $account->open_id, 'check_name' => 'NO_CHECK',// NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 - 'amount' => $amount, //单位为分,不小于100 + 'amount' => $amount, //单位为分,不小于300 'desc' => '验证优惠券签到奖励', ]; @@ -815,7 +812,7 @@ class Coupon extends Base "mch_billno" => $mch_billno, "openid" => $account->open_id, "user_code" => $account->user_code, - "money" => $consumerMoney, + "money" => $amount, //单位为分,不小于300 "create_time" => date("Y-m-d H:i:s",$time), "pay_time" => '0000-00-00 00:00:00', ];