|
@@ -4,9 +4,9 @@ namespace app\inter\service;
|
|
|
use think\Db;
|
|
|
|
|
|
class WechatService {
|
|
|
- public function pushWechatOrder($exam_id) {
|
|
|
+ public static function pushWechatOrder($exam_id) {
|
|
|
var_dump($exam_id);
|
|
|
- $openids = $this->getPushOpenId($exam_id);
|
|
|
+ $openids = self::getPushOpenId($exam_id);
|
|
|
var_dump($openids);
|
|
|
if(!$openids) {
|
|
|
log::record('---------没有找到对应openid--------');
|
|
@@ -17,7 +17,7 @@ class WechatService {
|
|
|
$url = "http://wechat.pacsonline.cn/wx_patient/api/sendMsg?pushType=1&openid=";
|
|
|
$full_url = $url . $v['openid'];
|
|
|
// 请求
|
|
|
- $res = $this->curl_request($full_url, 'GET');
|
|
|
+ $res = self::curl_request($full_url, 'GET');
|
|
|
}
|
|
|
return true;
|
|
|
// http://wechat.pacsonline.cn/wx_patient/api/sendMsg?pushType=1&openid=
|
|
@@ -31,7 +31,7 @@ class WechatService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private function getPushOpenId($exam_id) {
|
|
|
+ private static function getPushOpenId($exam_id) {
|
|
|
$exams = DB::table("exams")
|
|
|
->alias('e')
|
|
|
->join('studies s', 'e.study_id = s.id')
|
|
@@ -81,7 +81,7 @@ class WechatService {
|
|
|
return Db::query($sql, $options);
|
|
|
}
|
|
|
|
|
|
- private function curl_request($url,$method='get',$data=null,$https=true){
|
|
|
+ private static function curl_request($url,$method='get',$data=null,$https=true){
|
|
|
//1.初识化curl
|
|
|
$ch = curl_init($url);
|
|
|
//2.根据实际请求需求进行参数封装
|