zqwang 1 year ago
parent
commit
54ad92497a

+ 11 - 11
modules/Channel/Http/Controllers/WechatOpenPlatformController.php

@@ -130,13 +130,13 @@ class WechatOpenPlatformController extends CatchController
 
         $server = $openPlatform->server;
         $message = $server->getMessage();
-        // myLog("wx-xiaoxi")->info('-------开始处理---'.get_date());
-        // myLog("wx-xiaoxi")->info([
-        //     'authorizer_appid' => $authorizer_appid,
-        //     'component_appid' => $component_appid,
-        //     'param' => $request->all(),
-        //     'msg' => $message,
-        // ]);
+        myLog("wx-xiaoxi")->info('-------开始处理---'.get_date());
+        myLog("wx-xiaoxi")->info([
+            'authorizer_appid' => $authorizer_appid,
+            'component_appid' => $component_appid,
+            'param' => $request->all(),
+            'msg' => $message,
+        ]);
         $appInfo = WechatOpenPlatformService::getRefreshToken($authorizer_appid,$component_appid);
         $wechatAppId = getProp($appInfo,'id');
 
@@ -144,12 +144,12 @@ class WechatOpenPlatformController extends CatchController
         unset($appInfo);
 
         $app->server->push(function ($message) use($app,$authorizer_appid,$wechatAppId) {
-            // myLog("wx-xiaoxi")->info("----文本消息---");
-            // myLog("wx-xiaoxi")->info("体消息:");
-            // myLog("wx-xiaoxi")->info($message);
+            myLog("wx-xiaoxi")->info("----文本消息---");
+            myLog("wx-xiaoxi")->info("体消息:");
+            myLog("wx-xiaoxi")->info($message);
             return WechatCommonService::handleMessage($app,$wechatAppId ,$authorizer_appid,$message);
         });
-        // myLog("wx-xiaoxi")->info('-------结束处理---'.get_date());
+        myLog("wx-xiaoxi")->info('-------结束处理---'.get_date());
         return $app->server->serve()->send();
     }
 }

+ 3 - 3
modules/WechatPlatform/Services/WechatCommonService.php

@@ -61,7 +61,7 @@ class WechatCommonService extends BaseService
             // case 'file':
             //     return '收到文件消息';
             default:
-                self::updateUserActivityTime($app, $appid, $message['FromUserName']);
+                self::updateUserActivityTime($app, $appid, $message['FromUserName'],$wechatInfoId);
                 return '收到其它消息';
         }
         return "";
@@ -159,7 +159,7 @@ class WechatCommonService extends BaseService
         }
     }
 
-    /**
+    /**3
      *  构建用户数据
      * name: getUserInfo
      * @param $app
@@ -169,7 +169,7 @@ class WechatCommonService extends BaseService
      */
     protected  static  function getUserInfo($app,$appid,$openId, $wechatInfoId){
         $user = $app->user->get($openId);
-        $data = [
+        return [
             'mp_openid' => $openId,
             'gzh_appid' => $appid,
             'gzh_id' => $wechatInfoId,