master
wangxinglong 2021-12-29 10:42:17 +08:00
parent fd213a7b4b
commit b2ea9bcf2f
1 changed files with 9 additions and 7 deletions

View File

@ -476,7 +476,7 @@ class Coupon extends Base
Log::info("查询企业付款失败:".json_encode($result,JSON_UNESCAPED_UNICODE));
}else{
$mch_billno = createUuid();
$amount = $consumerMoney*100;
$amount = $consumerMoney * 100;
$toBalanceData = [
'partner_trade_no' => $mch_billno,// 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号)
'openid' => $account->open_id,
@ -484,15 +484,17 @@ class Coupon extends Base
'amount' => $amount, //单位为分不小于100
'desc' => '验证优惠券签到',
];
$result = $payment->transfer->toBalance($toBalanceData);
//不发起支付
//$result = $payment->transfer->toBalance($toBalanceData);
//var_dump($result);
//付款成功才提交!!!!!伪装成功
if(isset($result['payment_no']) || true ){
if(true||isset($result['payment_no']) ){
Db::commit();
return $this->json(0,"优惠券签到使用成功,您获得{$consumerMoney}元红包,已存入您的零钱");
}
Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
//Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
}
//默认回滚
@ -633,9 +635,9 @@ class Coupon extends Base
* */
public function edit()
{
$accountId = $this->request->user['user_id'] ?? 0;
$couponMainId = input("couponMainId/d");
$account = AccountRepository::getInstance()->findById($accountId, [], function ($q) {
$accountId = $this->request->user['user_id'] ?? 0;
$couponMainId = input("couponMainId/d");
$account = AccountRepository::getInstance()->findById($accountId, [], function ($q) {
return $q->with(['business'=>function($q){
$q->lock(true);
}, 'parent']);