Browse Source

支付完订单,发送im自定义消息

lizhen_gitee 10 months ago
parent
commit
e0be56f22d

+ 4 - 1
application/api/controller/Demo.php

@@ -65,14 +65,17 @@ class Demo extends Api
     {
         $tenim = new Tenim();
 
+        $order_id = 26;
+
         $message = [
             'businessID' => 'order_status',
             'name' => '待接单',
             'status' => '10',
-            'id' => 16,
+            'id' => (string)$order_id,
             'content' => '已通知医生尽快接诊,超时自动取消订单并退款',
         ];
 
+
         $rs = $tenim->sendCustomMessageToUser('user7','doctor7',$message);
         dump($rs);
     }

+ 1 - 1
application/api/controller/Wenzhen.php

@@ -154,7 +154,7 @@ class Wenzhen extends Api
                     'businessID' => 'order_status',
                     'name' => '待接单',
                     'status' => '10',
-                    'id' => $order_id,
+                    'id' => (string)$order_id,
                     'content' => '已通知医生尽快接诊,超时自动取消订单并退款',
                 ];
                 $rs = $tenim->sendCustomMessageToUser('user'.$this->auth->id,'doctor'.$wenzhen_order['doctor_id'],$message);

+ 1 - 0
application/common/library/Tenim.php

@@ -95,6 +95,7 @@ class Tenim
                 "Sound"=> '',
             ],
         ];
+        $data['CloudCustomData'] = $message['id'];
         $res = $tencentObj->toSend($data);
 
         if (empty($res['ActionStatus']) || $res['ActionStatus'] != 'OK') {