master
wangxinglong 2022-02-08 10:03:36 +08:00
parent 3fdcd0fba6
commit 6fbd1168cd
1 changed files with 16 additions and 5 deletions

View File

@ -199,6 +199,8 @@ class Coupon extends Base
$whereMap = [];
$fields = [
'id',
'coupon_id',
'business_code',
'is_verificated as isVerificated',
'money',
'name as couponName',
@ -215,7 +217,16 @@ class Coupon extends Base
$sortOrder = ['sort_weight' => 'desc', 'end_time' => 'asc'];
$res = CouponRepository::getInstance()->findList($whereMap, $fields, $page, $size,function ($q){
return $q->with(["couponMain","scoreModel"]);
return $q->with(
[
"couponMain" => function ($q) {
$q->field("id,name,image_url");
},
"scoreModel",
"business" => function ($q) {
$q->field("id,code,business_name");
}
]);
}, $sortOrder);
$res['list'] ->each(function ($item){
@ -530,17 +541,17 @@ class Coupon extends Base
'amount' => $amount, //单位为分不小于100
'desc' => '验证优惠券签到',
];
//发起支付
//$result = $payment->transfer->toBalance($toBalanceData);
//发起支付
$result = $payment->transfer->toBalance($toBalanceData);
//var_dump($result);
//付款成功才提交!!!!!伪装成功
if(true||isset($result['payment_no']) ){
if(isset($result['payment_no']) ){
Db::commit();
return $this->json(0,"优惠券签到使用成功,您获得{$consumerMoney}元红包,已存入您的零钱",["redPacket"=>$consumerMoney]);
}
//Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
}
//默认回滚