Ver código fonte

add - 用户发券公众号通知

liugc 10 meses atrás
pai
commit
d58aacbc93

+ 10 - 0
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -1288,6 +1288,16 @@ class ServiceWorkLogic extends BaseLogic
                     $userCouponLogic = UserCouponLogic::add(['codes'=>$codes,'user_id'=>$serviceWork->user_id]);
                     Log::info('工单中给用户发券:'.$serviceWork->user_id.'--'.json_encode($codes).'--'.json_encode($userCouponLogic));
                     if($userCouponLogic === false) throw new \Exception(UserCouponLogic::getError());
+                    if(empty(UserCouponLogic::getError())){
+                        // 通知用户公众号 跳转优惠券
+                        event('Notice',  [
+                            'scene_id' => 129,
+                            'params' => [
+                                'user_id' => $serviceWork->user_id,
+                                'order_id' => $serviceWork->id,
+                            ]
+                        ]);
+                    }
                 }
             }
             return true;

+ 3 - 0
app/common/logic/NoticeLogic.php

@@ -186,6 +186,9 @@ class NoticeLogic extends BaseLogic
             case 124: //返修工程师预约上门通知
                 $page = "/subPages/return_work_detail/return_work_detail?id={$extraId}";
                 break;
+            case 129: //用户券页面
+                $page = "/pages/center/discounts?type=0";
+                break;
         }
 
         // 公众号主页路径