diff --git a/app/Amqp/Consumer/couponRebateConsumer.php b/app/Amqp/Consumer/couponRebateConsumer.php index f9a3808..c3eb85a 100644 --- a/app/Amqp/Consumer/couponRebateConsumer.php +++ b/app/Amqp/Consumer/couponRebateConsumer.php @@ -16,7 +16,7 @@ use Hyperf\Di\Annotation\Inject; /** - * @Consumer(exchange="deviceCouponRebate", routingKey="deviceCouponRebate", queue="deviceCouponRebate", name ="couponRebateConsumer", nums=1) + * @Consumer(exchange="deviceCouponRebate1", routingKey="deviceCouponRebate1", queue="deviceCouponRebate1", name ="couponRebateConsumer", nums=1) */ class couponRebateConsumer extends ConsumerMessage { diff --git a/app/Service/CouponRebateService.php b/app/Service/CouponRebateService.php index 233a4ae..de89875 100644 --- a/app/Service/CouponRebateService.php +++ b/app/Service/CouponRebateService.php @@ -267,15 +267,15 @@ class CouponRebateService implements CouponRebateServiceInterface ->leftjoin('ims_system_coupon_user_use as u', 'u.user_receive_id', '=', 'r.id') ->where([ ['u.order_main_id', '=', $order_id], - ['r.send_user_id', '>', 0], - ['r.rebate_type', '=', 1], - ['r.receive_type', '=', 4], + // ['r.send_user_id', '>', 0], + // ['r.rebate_type', '=', 1], + // ['r.receive_type', '=', 4], ]) ->whereIn('r.system_coupon_user_id',$coupon_ids) ->select('r.user_id', 'r.send_user_id') ->first(); /* 如果使用的优惠券为转发活动优惠券 则给赠送者返一张优惠券*/ - if (isset($coupon->send_user_id) && ($coupon->send_user_id) > 0) { + if ($coupon) { //是否已返过券 $exists_coupon_rebate = Db::table('ims_system_coupon_user_receive') ->where([ @@ -289,7 +289,7 @@ class CouponRebateService implements CouponRebateServiceInterface Db::beginTransaction(); try { //返券 - if($exists_coupon_rebate->id){ + if($exists_coupon_rebate){ //如果已有该优惠券 则领取数量 和 可用数量 自增1 Db::table('ims_system_coupon_user_receive') ->where([ @@ -356,16 +356,6 @@ class CouponRebateService implements CouponRebateServiceInterface ); } } - $log_Data = array(); - $log_Data['name'] = '返券'; - $log_Data['user_id'] = $order_id; - $log_Data['send_user_id'] = $coupon->send_user_id; - $log_Data['order_main_id'] = $order_id; - $log_Data['msg'] = '返券成功'; - $this->log->event( - LogLabel::COUPON_LOG, - $log_Data - ); return true; }