|
@@ -5232,12 +5232,30 @@ class WholeController extends Curd
|
|
|
// 权益表
|
|
|
$this->insertMemberBenefit($params, $goods);
|
|
|
}
|
|
|
+
|
|
|
+ $this->sendCoupon($params, ['goods_id'=>$params['packageId']], $params['orderId']);
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
_syslog("下单", '权益设置失败');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function sendCoupon($params, $goods, $orderId)
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $couponSendParams = [
|
|
|
+ 'gettype' => 'PACKAGE',
|
|
|
+ 'member_id' => $params['join_order_member_id'],
|
|
|
+ 'orderId' => $orderId,
|
|
|
+ 'join_sheet_goods_id' => $goods['goods_id']
|
|
|
+ ];
|
|
|
+
|
|
|
+ CouponService::autoSendCouponByGoods($couponSendParams);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ throw new BusinessException("卡券发放失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
public function deductAccount($orderId, $orderGroup, $payWay)
|
|
|
{
|
|
|
$payDetails = PayDetail::where('join_pay_order_id', $orderGroup)
|