fuyu 5 lat temu
rodzic
commit
dbad330680
1 zmienionych plików z 15 dodań i 14 usunięć
  1. 15 14
      application/inter/service/WechatService.php

+ 15 - 14
application/inter/service/WechatService.php

@@ -2,27 +2,28 @@
 namespace app\inter\service;
 
 use think\Db;
+use think\Log;
 
 class WechatService {
 
 
   public function pushWechatOrder($exam_id) {
     var_dump($exam_id);
-    // $openids = $this->getPushOpenId($exam_id);
-    // var_dump($openids);
-    // if(!$openids) {
-    //   log::record('---------没有找到对应openid--------');
-    //   return false;
-    // }
+    $openids = $this->getPushOpenId($exam_id);
+    var_dump($openids);
+    if(!$openids) {
+      log::record('---------没有找到对应openid--------');
+      return false;
+    }
 
-    // foreach($openids as $v) {
-    //   $url   = "http://wechat.pacsonline.cn/wx_patient/api/sendMsg?pushType=1&openid=";
-    //   $full_url = $url . $v['openid'];
-    //   // 请求
-    //   $res = $this->curl_request($full_url, 'GET');
-    //   var_dump($res);
-    // }
-    // return true;
+    foreach($openids as $v) {
+      $url   = "http://wechat.pacsonline.cn/wx_patient/api/sendMsg?pushType=1&openid=";
+      $full_url = $url . $v['openid'];
+      // 请求
+      $res = $this->curl_request($full_url, 'GET');
+      var_dump($res);
+    }
+    return true;
   }
 
   public function pushWechatCancel() {