wupengfei 2 years ago
parent
commit
dd2708d72c
2 changed files with 5 additions and 4 deletions
  1. 2 2
      .idea/workspace.xml
  2. 3 2
      application/nutrition/controller/VideoUrl.php

+ 2 - 2
.idea/workspace.xml

@@ -3,7 +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/nutrition/controller/ArticleItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -200,7 +200,7 @@
       <workItem from="1670287594399" duration="11535000" />
       <workItem from="1670461023846" duration="27678000" />
       <workItem from="1670547445908" duration="12147000" />
-      <workItem from="1670633686675" duration="13179000" />
+      <workItem from="1670633686675" duration="13427000" />
     </task>
     <servers />
   </component>

+ 3 - 2
application/nutrition/controller/VideoUrl.php

@@ -154,10 +154,11 @@ class VideoUrl extends Controller
 
     protected function  _form_result($result)
     {
-        $url_num = \app\common\model\VideoUrl::where(['video_id'=>$this->request->post('video_id'),'is_deleted'=>0])->count();
+        $url_num = \app\common\model\VideoUrl::field('id,read_num')->where(['video_id'=>$this->request->post('video_id'),'is_deleted'=>0])->select()->toArray();
         $video_info =  VideoIntro::where('id',$this->request->post('video_id'))->find()->toArray();
         $url = $this->request->post('up_type',1) == 1 ? $this->request->post('up_url'):$this->request->post('path');
-        $up['url_num'] = $url_num;
+        $up['url_num'] = count($url_num);
+        $up['read_num'] = array_sum(array_column($url_num,'read_num'));
         if(!$video_info['cover']) $up['cover'] = $this->request->post('cover');
         if(!$video_info['video_url']) $up['video_url'] = $url;
         if(!$video_info['article_id'])  $up['article_id'] = $this->request->post('article_id');