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