فهرست منبع

视频收藏,隐藏错误

lizhen_gitee 8 ماه پیش
والد
کامیت
05fec34ae9
1فایلهای تغییر یافته به همراه10 افزوده شده و 6 حذف شده
  1. 10 6
      application/api/controller/Tvindex.php

+ 10 - 6
application/api/controller/Tvindex.php

@@ -318,6 +318,7 @@ class Tvindex extends Api
         if (!$info) {
             $this->error('数据不存在');
         }
+//var_dump($info);exit;
         $info['image'] = one_domain_image($info['image']);
         //查询是否收藏
         $count = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
@@ -330,8 +331,9 @@ class Tvindex extends Api
             Db::name('video')->where('id',$id)->setInc('collect_number',1); //收藏数增加
         }
         if (!$result) {
-            Db::rollback();
-            $this->error('操作失败');
+            /*Db::rollback();
+            $this->error('操作失败');*/
+            $this->success('操作成功');
         }
 
         $url = 'http://meta-history.unso.gitv.tv/OTT/jscmcc/addThirdPartyCollectionRecord';
@@ -371,13 +373,15 @@ class Tvindex extends Api
         $rt = httpRequest($url, 'POST', $content);
         file_put_contents('shoucang.txt',$id.'_'.$rt.PHP_EOL, FILE_APPEND);
         if (!$rt) {
-            Db::rollback();
-            $this->error('操作失败');
+            /*Db::rollback();
+            $this->error('操作失败');*/
+            $this->success('操作成功');
         }
         $rt = json_decode($rt, true);
         if (empty($rs) || $rt['code'] != 0) {
-            Db::rollback();
-            $this->error('操作失败');
+            /*Db::rollback();
+            $this->error('操作失败');*/
+            $this->success('操作成功');
         }
 
         //大数据上报