You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
873 B

  1. <?php
  2. header("Access-Control-Allow-Origin:*");
  3. $pdo=conn();
  4. $user_id = getUserId();
  5. $order_id_list = $_POST['order_id'];
  6. $send_context = $_POST['send_context'];
  7. $order_id_array = explode(",", $order_id_list);
  8. if( count($order_id_array) <= 0 || strlen(trim($send_context)) <= 0 ) {
  9. $json = array();
  10. $json['code'] = 0;
  11. $json['info'] = "发送成功";
  12. echo json_encode($json);
  13. }
  14. $send_message_api = CS1_DOMAIN."/api/msg/send-free-msg";
  15. foreach( $order_id_array as $send_order_id ) {
  16. $post_data = array( "order_id" => $send_order_id, "user_id" => $user_id,"send_message" => $send_context );
  17. $return_reponse = httpRequest($send_message_api,$post_data);
  18. writeLog( "SEND FREE MSG: {$send_message_api} | ".json_encode($post_data)." | ".$return_reponse );
  19. }
  20. $json = array();
  21. $json['code'] = 0;
  22. $json['info'] = "发送成功";
  23. echo json_encode($json);