15954078560 пре 2 година
родитељ
комит
312cbb0044
2 измењених фајлова са 90 додато и 0 уклоњено
  1. 1 0
      application/admin/controller/Video.php
  2. 89 0
      application/api/controller/Notify.php

+ 1 - 0
application/admin/controller/Video.php

@@ -183,6 +183,7 @@ class Video extends Backend
             if ($params) {
                 $params = $this->preExcludeFields($params);
                 $result = false;
+                $params['search_status'] = 0;
                 Db::startTrans();
                 try {
                     //是否采用模型验证

+ 89 - 0
application/api/controller/Notify.php

@@ -843,4 +843,93 @@ class Notify extends Api
         echo 'wan bi';
         die;
     }
+
+    //视频统一搜索生成ftp文件
+    public function videosearch() {
+        set_time_limit(0);
+
+//        $time = strtotime(date('Y-m-d', time()));
+        $where = array(
+            'inject_status' => 2,
+            'search_status' => 0,
+//            'updatetime' => ['egt', $time]
+        );
+
+        $hu_video = Db::name('video');
+        $list = $hu_video->where($where)->limit(50)->select();
+
+        if (!$list) {
+            echo 'mei shu ju';
+            die;
+        }
+
+        $header = [
+            'Content-Type: application/json'
+        ];
+
+        //生成ftp文件
+        $content = [
+            'cpPrvdName' => '健康e家',
+            'cpPrvCode' => '41000144',
+            'cpPrvType' => '1006',
+            'ChnName' => '健康',
+            'ChnCode' => '1000020',
+            'actors' => '无',
+            'directors' => '无',
+            'contentYear' => date('Y'),
+            'tags' => '',
+            'contentTime' => date('Y-m-d H:i:s'),
+            'formatType' => '超清'
+        ];
+        //增量接口
+        $insert_url = 'http://test.meta.unso.gitv.tv/sendMeta';
+        $method = 'POST';
+
+        foreach ($list as &$v) {
+            //生成ftp文件
+            $content['contentId'] = $v['movieid'];
+            $content['extraContentID'] = $v['movieid'];
+            $content['content'] = $v['title'];
+            $content['intent'] = [
+                'action' => 'com.huxiu.heh.tv.ui.video.detail.VideoDetailActivity',
+                'package' => 'com.huxiu.heh.tv',
+                'component' => [
+                    'pkg' => 'com.huxiu.heh.tv',
+                    'cls' => 'com.huxiu.heh.tv.ui.video.detail.VideoDetailActivity'
+                ],
+                'extras' => [
+//                        'cmd' => '',
+//                        'from' => '',
+//                        'media_id' => ''
+                    'type_id' => $v['video_type_id'],
+                    'id' => $v['id']
+                ]
+            ];
+            $content['isEffective'] = $v['status'];
+            $content['pic'] = one_domain_image($v['image']);
+            $content['isPaid'] = $v['is_pay'];
+
+            $content = json_encode($content, 320);
+            $filename = 'shipin_'.date('Ymd').'_'.date('His').'_increment'.'.json';
+            error_log(print_r($content, 1) . PHP_EOL, 3, './jiankang/' . $filename);
+            //调用增量注入接口
+
+            /*$postfields = [
+                'priKey' => config('cspid'),
+                'data' => [$content]
+            ];
+            $rt = httpRequest($insert_url, $method, $postfields, $header);
+            if (!$rt) {
+                continue;
+            }
+            $rt = json_decode($rt, true);
+            if ($rt['code'] != 'A000000') {
+                continue;
+            }*/
+            $hu_video->where(['id' => $v['id'], 'search_status' => 0])->setField(['search_status' => 1]);
+        }
+
+        echo 'wan bi';
+        die;
+    }
 }