wupengfei 2 年之前
父節點
當前提交
4e45770cf4
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 2 2
      .idea/workspace.xml
  2. 3 0
      application/api/controller/Press.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/api/controller/Demand.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Demand.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Press.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -198,7 +198,7 @@
       <workItem from="1669952538953" duration="9708000" />
       <workItem from="1670201125142" duration="9015000" />
       <workItem from="1670287594399" duration="11535000" />
-      <workItem from="1670461023846" duration="20943000" />
+      <workItem from="1670461023846" duration="21763000" />
     </task>
     <servers />
   </component>

+ 3 - 0
application/api/controller/Press.php

@@ -99,6 +99,7 @@ class Press extends Base
         })->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
         foreach ($list as &$v) {
             $v['comment_num'] = PressComment::where(['first_id'=>$v['id'],'type'=>1,'is_deleted'=>0])->count();
+            $v['comment_num'] = numTransform($v['comment_num']);
             $v['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$v['id']);
             $v['collect_num'] = UserCollect::getCollectNum(4,$v['id']);
             $v['is_praise'] = PlatformLike::checkTags($this->user_id,$v['id'],1);
@@ -137,6 +138,8 @@ class Press extends Base
         $detail = \app\common\model\Press::field('id,images,title,content,read_num,create_at,transmit_num,user_id,is_deleted,status')->where($sel_where)->find()->toArray();
         if($detail['is_deleted'] == 1 || $detail['status'] == 0) $this->error('该新闻已下架');
         $detail['comment_num'] = PressComment::where(['first_id'=>$detail['id'],'type'=>1,'is_deleted'=>0])->count();
+        $detail['comment_num'] = numTransform($detail['comment_num']);
+        $detail['transmit_num'] = numTransform($detail['transmit_num']);
         $detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$detail['id']);
         $detail['collect_num'] = UserCollect::getCollectNum(4,$detail['id']);
         $detail['is_praise'] = PlatformLike::checkTags($this->user_id,$detail['id'],1);