浏览代码

fix , 客服消息更新公众号

liuzejian 1 年之前
父节点
当前提交
d799de90fb

+ 5 - 2
modules/WechatPlatform/Http/Controllers/KFMessageController.php

@@ -45,10 +45,13 @@ class KFMessageController extends CatchController
             })->orderBy('id', 'desc')
             ->paginate($request->input('limit', 20));
         $gzhIds = $gzhs = $ugs =  collect();
-        $result->pluck('gzh_ids')->every(function ($item) use ($gzhIds){
+
+        foreach ($result->pluck('gzh_ids') as $item) {
             $gzhIds = $gzhIds->merge(explode('#', trim($item, '#')));
-        });
+        }
+
 
+        $gzhIds = $gzhIds->diff([''])->unique();
         if($gzhIds->isNotEmpty()) {
             $gzhs = DB::table('wechat_authorization_infos')
                 ->whereIn('id', $gzhIds)

+ 1 - 0
tests/WechatPlatform/Http/KFMessageControllerTest.php

@@ -35,6 +35,7 @@ AAA;
         $res = $this->withHeaders([
             'Authorization' => 'Bearer '. $this->token,
         ])->json('get','http://localhost/api/wechatPlatform/kfMessage/list', [
+            'id' => 8
         ]);
         $this->dumpJson($res);
     }