12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?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>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;
- }
- //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);*/
- }
- }
|