wugg 5 月之前
父节点
当前提交
07b2d1d892
共有 2 个文件被更改,包括 9 次插入8 次删除
  1. 8 7
      app/txx/listener/WxPush.php
  2. 1 1
      app/txx/model/ActGood.php

+ 8 - 7
app/txx/listener/WxPush.php

@@ -14,12 +14,12 @@ class WxPush
      *
      *
      * @return mixed
      * @return mixed
      */
      */
-    public function __construct()
-    {
-         $this->appid = env('WECHAT.APPID');
-        $this->appsecret = env('WECHAT.APPSECRET');
-        $this->wechat = new \Wechat(['appid' => $this->appid, 'appsecret' => $this->appsecret]);
-    }
+//    public function __construct()
+//    {
+//         $this->appid = env('WECHAT.APPID');
+//        $this->appsecret = env('WECHAT.APPSECRET');
+//        $this->wechat = new \Wechat(['appid' => $this->appid, 'appsecret' => $this->appsecret]);
+//    }
     public function handle($event)
     public function handle($event)
     {
     {
         if($event==null)return;
         if($event==null)return;
@@ -35,7 +35,7 @@ class WxPush
                 'code'=>$data['actCode'],
                 'code'=>$data['actCode'],
                 'belong'=>1,
                 'belong'=>1,
                 'openId'=>'oOpc26OhvWzdO0JlL9Q37rXyu69I',
                 'openId'=>'oOpc26OhvWzdO0JlL9Q37rXyu69I',
-                'template_id'=>'oUFsqOfVNgavlzQKs9bT1as1miFNJ5-Q-h68eFiiQ0Q',
+                'template_id'=>'oUFsgOfVNqavIzQKS9bT1as1miFNJ5-Q-h68eFiiQ0Q',
                 'template_name'=>'系统单据处理通知',
                 'template_name'=>'系统单据处理通知',
                 'action_name'=>'泰行销活动审批推送',
                 'action_name'=>'泰行销活动审批推送',
                 'template_data'=>['thing8' => ['value' => '泰行销直播'],
                 'template_data'=>['thing8' => ['value' => '泰行销直播'],
@@ -47,6 +47,7 @@ class WxPush
                 'uid'=>106,
                 'uid'=>106,
                 'uname'=>'魏莉',
                 'uname'=>'魏莉',
             ];
             ];
+        Log::info("推送数据".json_encode($temps,JSON_UNESCAPED_UNICODE));
         Cache::store('redis')->handler()->lPush('wxpush_queue',json_encode($temps));
         Cache::store('redis')->handler()->lPush('wxpush_queue',json_encode($temps));
     }
     }
 }
 }

+ 1 - 1
app/txx/model/ActGood.php

@@ -44,7 +44,7 @@ class ActGood extends Model
                         $act->status=$actStatus[$goodStatus];
                         $act->status=$actStatus[$goodStatus];
                         $save=$act->save();
                         $save=$act->save();
                         if($save&&$act->status==3){ //发送微信通知
                         if($save&&$act->status==3){ //发送微信通知
-                            event("wxPush",$act->toArray());
+                            event("WxPush",$act->toArray());
                         }
                         }
                     }
                     }
                }
                }