wupengfei vor 2 Jahren
Ursprung
Commit
cb87b615ce

+ 4 - 1
.idea/workspace.xml

@@ -3,6 +3,9 @@
   <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/Activity.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Activity.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Video.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Video.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserCollect.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserCollect.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -197,7 +200,7 @@
       <workItem from="1669952538953" duration="9708000" />
       <workItem from="1670201125142" duration="9015000" />
       <workItem from="1670287594399" duration="11535000" />
-      <workItem from="1670461023846" duration="17431000" />
+      <workItem from="1670461023846" duration="17657000" />
     </task>
     <servers />
   </component>

+ 2 - 0
application/api/controller/Activity.php

@@ -74,6 +74,7 @@ class Activity extends Base
         $sql = "SELECT $field FROM " .$table . " a LEFT JOIN ( SELECT id,IF(id,1,1) is_recommend FROM $table b WHERE ( $where_str )) AS c ON c.id = a.id  WHERE a.is_deleted = 0 AND a.status = 1  ORDER BY is_recommend DESC , $order_by_two desc LIMIT {$this->off_set},{$this->page_num}";
         $list = Db::query($sql);
         array_walk($list,function (&$v,$k){
+            $v['read_num'] = numTransform( $v['read_num']);
             $v['cover_arr'] = $v['cover'] ? explode('|',$v['cover']) : null;
             $v['cover'] = $v['cover_arr'] ? $v['cover_arr'][0]:null;
             $v['is_apply'] = ActivityApply::checkApply($this->user_id,$v['id']);
@@ -129,6 +130,7 @@ class Activity extends Base
                 if($title) $query->where('title|label','like','%'.$title.'%');
             })->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
         foreach ($list as &$v) {
+            $v['read_num'] = numTransform( $v['read_num']);
             $v['cover_arr'] = $v['cover'] ? explode('|',$v['cover']) : null;
             $v['label_name'] = $v['label'] ?  explode(',',trim($v['label'],',')): null;
             $v['is_apply'] = ActivityApply::checkApply($this->user_id,$v['id']);

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

@@ -416,6 +416,7 @@ 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();
         }
 
         $detail['read_num']  = array_sum(array_column($detail['video_arr'],'read_num'));

+ 3 - 1
application/common/model/UserCollect.php

@@ -26,7 +26,9 @@ class UserCollect extends Model
         $where['coll_type'] = $type;
         $where['coll_id'] = $id;
         if($children_id) $where['children_id'] = $children_id;
-        return self::where($where)->count() ;
+        $num =self::where($where)->count();
+        $num=  numTransform($num);
+        return$num ;
     }