wupengfei 2 роки тому
батько
коміт
a22cc389e4
2 змінених файлів з 5 додано та 4 видалено
  1. 2 1
      .idea/workspace.xml
  2. 3 3
      application/api/controller/Video.php

+ 2 - 1
.idea/workspace.xml

@@ -3,6 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Video.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Video.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -197,7 +198,7 @@
       <workItem from="1669952538953" duration="9708000" />
       <workItem from="1670201125142" duration="9015000" />
       <workItem from="1670287594399" duration="11535000" />
-      <workItem from="1670461023846" duration="22347000" />
+      <workItem from="1670461023846" duration="22476000" />
     </task>
     <servers />
   </component>

+ 3 - 3
application/api/controller/Video.php

@@ -409,6 +409,7 @@ class Video extends Base
             $detail['label_name'] = explode(',',trim($detail['label'],','));
         }
         $level_id = UserLevelRank::getUserVip($this->user_id);
+        $detail['read_num']  = array_sum(array_column($detail['video_arr'],'read_num'));
         foreach ($detail['video_arr'] as &$dv) {
             if($dv['is_vip'] && !$level_id) $dv['url'] = '';
             $dv['is_collect'] = UserCollect::checkCollectByType($this->user_id,1,$detail['id'],$dv['id']);
@@ -416,10 +417,9 @@ class Video extends Base
             $dv['collect_num'] =  UserCollect::getCollectNum(1,$detail['id'],$dv['id']);
             $dv['is_praise'] = VideoCommentLike::where(['user_id'=>$this->user_id,'type'=>2,'like_id'=>$dv['id']])->count();
             $dv['praise_num'] = VideoCommentLike::where(['type'=>2,'like_id'=>$dv['id']])->count();
-            $dv['praise_num'] = VideoCommentLike::where(['type'=>2,'like_id'=>$dv['id']])->count();
+            $dv['praise_num'] = numTransform($dv['praise_num']);
+            $dv['read_num'] = numTransform($dv['read_num']);
         }
-
-        $detail['read_num']  = array_sum(array_column($detail['video_arr'],'read_num'));
         $this->success('ok',['detail'=>$detail]);
     }