Explorar el Código

删除中兴注入

15954078560 hace 2 años
padre
commit
3f17e6affc
Se han modificado 2 ficheros con 98 adiciones y 4 borrados
  1. 21 3
      application/admin/controller/Video.php
  2. 77 1
      application/api/controller/Notify.php

+ 21 - 3
application/admin/controller/Video.php

@@ -136,7 +136,7 @@ class Video extends Backend
                                 'tvIsOnline' => $params['status'],
                                 'isPurchase' => $params['is_pay'],
                                 'playOrder' => 1,
-                                'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/'.$video_url
+                                'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/inject/'.$video_url
                             ]
                         ]
                     ];
@@ -242,7 +242,7 @@ class Video extends Backend
                                 'tvIsOnline' => $params['status'],
                                 'isPurchase' => $params['is_pay'],
                                 'playOrder' => 1,
-                                'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/'.$video_url
+                                'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/inject/'.$video_url
                             ]
                         ]
                     ];
@@ -299,6 +299,10 @@ class Video extends Backend
 //        $url = 'http://'.config('inject_ip').':'.config('inject_port').'/epgDeleteSync/v1/' . $cspid;
         $url = 'http://jscp.agency.gitv.tv/epgDeleteSync/v1/' . $cspid . '/';
 
+        $videofile = $params['videofile'];
+        $videofile = explode('/', $videofile);
+        $video_url = $videofile[3];
+
         $data = [
 //            'cspId' => $cspid,
             'cpAlbumId' => $ids,
@@ -321,7 +325,7 @@ class Video extends Backend
                     'tvIsOnline' => 2,
                     'isPurchase' => $params['is_pay'],
                     'playOrder' => 1,
-                    'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/'.$params['title'].'.mp4'
+                    'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/inject/'.$video_url
                 ]
             ]
         ];
@@ -341,6 +345,20 @@ class Video extends Backend
             $this->error('删除失败');
         }
 
+        //删除中兴内容
+        $url2 = 'http://jscp.agency.gitv.tv/epgDeleteSync/v1/' . config('cspid_zx') . '/';
+        $rs2 = httpRequest($url2, 'POST', $data, $header);
+        /*if (!$rs2) {
+            Db::rollback();
+            $this->error('删除失败');
+        }
+
+        $rs2 = json_decode($rs2, true);
+        if ($rs2['code'] != 'A000000') {
+            Db::rollback();
+            $this->error('删除失败');
+        }*/
+
         //生成ftp文件
         $content = [
             'cpPrvdName' => '健康e家',

+ 77 - 1
application/api/controller/Notify.php

@@ -719,6 +719,18 @@ class Notify extends Api
 
     //视频注入结果查询
     public function injectquery() {
+        $url = 'http://jscp.agency.gitv.tv/injectResult/v1/queryTv?cspId=' . config('cspid_zx') . '&cpAlbumId=121&cpTvId=121';
+        $header = [
+            'Content-Type: application/json'
+        ];
+        $rs = httpRequest($url, 'GET', [], $header);
+        if (!$rs) {
+            echo 1;
+        }
+        $rs = json_decode($rs, true); p($rs);die;
+        if ($rs['code'] != 'A000000') {
+            echo 2;
+        }
         set_time_limit(0);
 
         $time = strtotime(date('Y-m-d', time()));
@@ -999,7 +1011,7 @@ class Notify extends Api
                         'tvIsOnline' => $params['status'],
                         'isPurchase' => $params['is_pay'],
                         'playOrder' => 1,
-                        'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/'.$video_url
+                        'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/inject/'.$video_url
                     ]
                 ]
             ];
@@ -1020,4 +1032,68 @@ class Notify extends Api
         echo 'wan bi';
         die;
     }
+
+    //(补漏)删除注入中兴视频
+    public function delinjectzx() {
+        set_time_limit(0);
+
+        $hu_video = Db::name('video');
+        $list = $hu_video->limit(1)->order('id')->select();
+
+        if (!$list) {
+            echo 'mei shu ju';
+            die;
+        }
+
+        $cspid = config('cspid_zx');
+        $url = 'http://jscp.agency.gitv.tv/epgDeleteSync/v1/' . $cspid . '/';
+
+        foreach ($list as &$params) {
+            //内容同步
+            $videofile = $params['videofile'];
+            $videofile = explode('/', $videofile);
+            $video_url = $videofile[3];
+
+            $data = [
+//            'cspId' => $cspid,
+                'cpAlbumId' => $params['id'],
+                'albumName' => $params['title'],
+                'tvSets' => 1,
+                'updateToSet' => 1,
+                'isPurchase' => $params['is_pay'],
+                'isEffective' => 0,
+                'isOnline' => 2,
+                'albumTypes' => '健康',
+                'picBox' => config('upload.cdnurl') . $params['image'],
+                'albumUpdateTime' => date('YmdHis', time()),
+//                'albumCreateTime' => date('YmdHis', time()),
+                'tvlist' => [
+                    [
+                        'cpAlbumId' => $params['id'],
+                        'cpTvId' => $params['id'],
+                        'tvName' => $params['title'],
+                        'tvIsEffective' => 0,
+                        'tvIsOnline' => 2,
+                        'isPurchase' => $params['is_pay'],
+                        'playOrder' => 1,
+                        'tvUrl' => 'ftp://'.config('ftp_user').':'.config('ftp_pwd').'@'.config('ftp_ip').':'.config('ftp_port').'/inject/'.$video_url
+                    ]
+                ]
+            ];
+            $data = json_encode($data, 320);
+            $header = [
+                'Content-Type: application/json'
+            ];
+            $rs = httpRequest($url, 'POST', $data, $header);
+            if ($rs) {
+                $rs = json_decode($rs, true);
+                if ($rs['code'] != 'A000000') {
+                    continue;
+                }
+            }
+        }
+
+        echo 'wan bi';
+        die;
+    }
 }