Explorar el Código

fix #1071 采集网址入库重复规则增加跳转url

magicblack hace 2 años
padre
commit
b11728188e

+ 1 - 0
application/admin/view/system/configcollect.html

@@ -532,6 +532,7 @@
                         <div class="layui-input-block">
                             <input type="checkbox" lay-skin="primary" name="collect[website][inrule][]" value="a" title="{:lang('name')}" checked disabled>
                             <input type="checkbox" lay-skin="primary" name="collect[website][inrule][]" value="b" title="{:lang('type')}" {if condition="strpos($config['collect']['website']['inrule'],'b') !==false"}checked {/if}>
+                            <input type="checkbox" lay-skin="primary" name="collect[website][inrule][]" value="c" title="{:lang('jumpurl')}" {if condition="strpos($config['collect']['website']['inrule'],'c') !==false"}checked {/if}>
                         </div>
                     </div>
 

+ 2 - 3
application/api/controller/Provide.php

@@ -191,7 +191,7 @@ class Provide extends Base
                 $v["vod_pic"] = $GLOBALS['config']['api']['vod']['imgurl'] . $v["vod_pic"];
             }
 
-            if($this->_param['ac']=='videolist' || $this->_param['ac']=='detail'){
+            if ($this->_param['ac']=='videolist' || $this->_param['ac']=='detail') {
                 // 如果指定返回播放组,则只返回对应播放组的播放数据
                 // https://github.com/magicblack/maccms10/issues/957
                 if (!empty($GLOBALS['config']['api']['vod']['from'])) {
@@ -221,8 +221,7 @@ class Provide extends Base
                     $res['list'][$k]['vod_play_server'] = join('$$$', $vod_play_server_list);
                     $res['list'][$k]['vod_play_note'] = join('$$$', $vod_play_note_list);
                 }
-            }
-            else {
+            } else {
                 if (!empty($GLOBALS['config']['api']['vod']['from'])) {
                     // 准备数据,逐个处理
                     $arr_from = explode('$$$', $v['vod_play_from']);

+ 7 - 3
application/common/model/Collect.php

@@ -713,10 +713,9 @@ class Collect extends Base {
 
                 if (!$info) {
                     // 新增
-                    if($param['opt'] == 2){
+                    if ($param['opt'] == 2) {
                         $des= lang('model/collect/not_check_add');
-                    }
-                    else {
+                    } else {
                         if ($param['filter'] == 1 || $param['filter'] == 2) {
                             $v['vod_play_from'] = (string)join('$$$', (array)$collect_filter['play'][$param['filter']]['cj_play_from_arr']);
                             $v['vod_play_url'] = (string)join('$$$', (array)$collect_filter['play'][$param['filter']]['cj_play_url_arr']);
@@ -2137,6 +2136,11 @@ class Collect extends Base {
                 if (strpos($config['inrule'], 'b')!==false) {
                     $where['type_id'] = $v['type_id'];
                 }
+                // 采集网址入库重复规则建议增加跳转url
+                // https://github.com/magicblack/maccms10/issues/1071
+                if (strpos($config['inrule'], 'c')!==false) {
+                    $where['website_jumpurl'] = $v['website_jumpurl'];
+                }
 
                 $info = model('Website')->where($where)->find();
                 if (!$info) {