123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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 westkissDr(){
- $data = $_REQUEST;
- if($data['status']){
- $this->results($data);
- echo 'success';
- }else{
- echo 'error';
- }
- }
- 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>40){//失败数量大于40条 删除待发送
- $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);//获取ly_sms_data_tmp_new fid
- $admin->delete_smslog_dr($uid);
- foreach ($lists as $v){
- $fid=$v['fid'];
- $count=$v['counts'];
- if($fid) {
- $admin->up_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;
- }
- //http://email.alipearl.net/
- public function wigginsDr(){
- $data = $_REQUEST;
- if($data['status']){
- $this->results($data);
- echo 'success';
- }else{
- echo 'error';
- }
- }
- public function alipearlDr(){
- $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);*/
- }
- }
|