|
@@ -0,0 +1,103 @@
|
|
|
+<?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/
|
|
|
+ // AP 新系统二 http://marketing.alipearl.net/
|
|
|
+ public function westkissDid(){
|
|
|
+ $data = $_REQUEST;
|
|
|
+ if($data['messageId']){
|
|
|
+ $this->results($data);
|
|
|
+ echo 'success';
|
|
|
+ }else{
|
|
|
+ echo 'error';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ public function results($data){
|
|
|
+ $messageid =$data['messageId'];
|
|
|
+ $cmessageid = explode('-',$messageid);
|
|
|
+ $cmessageid=$cmessageid[0];
|
|
|
+ $data['group_dr_id']=$cmessageid;
|
|
|
+ $admin = new AdvertAdminAction();
|
|
|
+ $where =" where remarks='{$cmessageid}'" ;
|
|
|
+ $list = $admin->select_smslog_new_query($where);//牛信云发送日志查询
|
|
|
+ $uid =$list[0]['uid'];
|
|
|
+ $data['status']=1;
|
|
|
+ $data['uid']=$uid;
|
|
|
+ $data['mobile']=$this->checkMobileCode($data['fromPhone']);
|
|
|
+ if(strpos($data['content'],'stop')){//客户取消订阅
|
|
|
+ $data['status']=2;
|
|
|
+ $is_send =2;
|
|
|
+ if($uid){
|
|
|
+ $admin->upDidSmsCustomer($is_send,$data['mobile'],$uid);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $admin->addDidLog($data);
|
|
|
+ }
|
|
|
+ public function checkMobileCode($mobile){
|
|
|
+ $mobile= str_replace('-', '', $mobile);
|
|
|
+ $mobile= str_replace('_', '', $mobile);
|
|
|
+ $mobile= str_replace('(', '', $mobile);
|
|
|
+ $mobile= str_replace(')', '', $mobile);
|
|
|
+ $mobile= str_replace('+', '', $mobile);
|
|
|
+ $mobile= str_replace(' ', '', $mobile);
|
|
|
+ $mobile=trim($mobile);
|
|
|
+ $frist =(int)substr($mobile, 0, 1 );
|
|
|
+ $lenth=strlen($mobile);
|
|
|
+ if($lenth==11&&$frist==1){//例:14696305087
|
|
|
+ $mobile =substr($mobile , 2 , 10);
|
|
|
+ }
|
|
|
+ return $mobile;
|
|
|
+ }
|
|
|
+ public function getCount($key){
|
|
|
+ $redis=$this->redis();
|
|
|
+ $count = $redis->exists($key) ? $redis->get($key) : 0;
|
|
|
+ $redis->set($key, ++$count);
|
|
|
+ return $count;
|
|
|
+ }
|
|
|
+
|
|
|
+ //http://email.alipearl.net/
|
|
|
+ public function wigginsDid(){
|
|
|
+ $data = $_REQUEST;
|
|
|
+ if($data['status']){
|
|
|
+ $this->results($data);
|
|
|
+ echo 'success';
|
|
|
+ }else{
|
|
|
+ echo 'error';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function alipearlDid(){
|
|
|
+ $data = $_REQUEST;
|
|
|
+ if($data['status']){
|
|
|
+ $this->results($data);
|
|
|
+ echo 'success';
|
|
|
+ }else{
|
|
|
+ echo 'error';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);*/
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|