Browse Source

短信回执

bianjunhui 2 năm trước cách đây
mục cha
commit
9363897841
1 tập tin đã thay đổi với 72 bổ sung0 xóa
  1. 72 0
      api/mod/sms.php

+ 72 - 0
api/mod/sms.php

@@ -0,0 +1,72 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2022/11/28 0028
+ * Time: 9:17
+ */
+require_once(ONU_ROOT . 'application/lib/data/adminAction.php');
+
+class ONUService{
+
+   // WK AS Y H 老系统   https://edm.alipearl.net/
+    //  wiggins AP 新系统  http://email.alipearl.net/
+    public  function westkissDr(){
+        $data = $_REQUEST;
+        $this->results($data);
+        echo 'success';
+    }
+    public  function results($data){
+        $messageid  =$data['messageid'];
+        $cmessageid 	= explode('-',$messageid);
+        $cmessageid=$cmessageid[0];
+        $status=$data['status'];
+        if($status!=2){//状态代码:2:成功下发,其他数字都未下发成功
+            $key=$cmessageid.'error';
+        }else{
+            $key=$cmessageid.'success';
+        }
+        $data['group_dr_id']=$cmessageid;
+        $admin = new AdvertAdminAction();
+        $admin->addDrLog($data);
+        $count=$this->getCount($key);
+        if($status!=2&&$count>50){//失败数量大于50条 删除待发送
+            $where =" where remarks='{$cmessageid}'" ;
+            $list = $admin->select_smslog_new_query($where);//牛信云发送日志查询
+            $uid =$list[0]['uid'];
+            $wheres =" where uid='{$uid}'" ;
+            $lists = $admin->select_sms_data_tmp_new($wheres);
+            $fid=$lists[0]['fid'];//获取ly_sms_data_tmp_new fid
+            $count=count($lists);
+            if($fid) {
+               $admin->delete_smslog_dr($uid,$fid,$count);
+            }
+        }
+    }
+
+    public  function getCount($key){
+        $redis=$this->redis();
+        $count = $redis->exists($key) ? $redis->get($key) : 0;
+        $redis->set($key, ++$count);
+        return $count;
+    }
+
+
+    public  function wigginsDr(){
+        $data = $_REQUEST;
+        $this->results($data);
+        echo 'success';
+    }
+    public  function redis(){
+        $redis = new Redis();
+        $redis->connect('127.0.0.1', 6379);
+        $redis->select(8);
+        return $redis;
+       /* $count = $redis->exists('count') ? $redis->get('count') : 1;
+        echo $count;
+        $redis->set('count', ++$count);*/
+    }
+
+
+
+}