wupengfei 2 年之前
父节点
当前提交
d5f99fce89

+ 5 - 4
.idea/workspace.xml

@@ -3,8 +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/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Press.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/press/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/press/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/PlatformComment.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/PressComment.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -123,7 +124,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/operate/view" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/common/model" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -134,9 +135,9 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\application\common\model" />
       <recent name="D:\zs\gaoyixia\application\operate\view" />
       <recent name="D:\zs\gaoyixia\application\operate\controller" />
-      <recent name="D:\zs\gaoyixia\application\common\model" />
       <recent name="D:\zs\gaoyixia\application\operate\view\forum" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
     </key>
@@ -202,7 +203,7 @@
       <workItem from="1662342663926" duration="3749000" />
       <workItem from="1662424055312" duration="8281000" />
       <workItem from="1662528828371" duration="14923000" />
-      <workItem from="1662597494801" duration="7106000" />
+      <workItem from="1662597494801" duration="8895000" />
     </task>
     <servers />
   </component>

+ 0 - 4
application/api/controller/Forum.php

@@ -1,11 +1,7 @@
 <?php
 namespace app\api\controller;
-use AlibabaCloud\SDK\Vod\V20170321\Models\GetMediaDNAResultResponseBody\DNAResult\videoDNA\detail\input;
-use app\admin\controller\User;
-use app\common\model\DatumIntro;
 use app\common\model\ForumReply;
 use app\common\model\ForumReplyComment;
-use app\common\model\PlatformComment;
 use app\common\model\PlatformLike;
 use app\common\model\PlatformSwitch;
 use app\common\model\UserCollect;

+ 15 - 15
application/api/controller/Press.php

@@ -1,6 +1,6 @@
 <?php
 namespace app\api\controller;
-use app\common\model\PlatformComment;
+use app\common\model\PressComment;
 use app\common\model\PlatformLike;
 use app\common\model\UserCollect;
 use library\tools\Data;
@@ -57,7 +57,7 @@ class Press extends Base
             if($title) $query->where('title','like','%.'.$title.'%');
         })->order('sort desc,id desc')->limit($this->off_set,$this->page_num)->select()->toArray();
         foreach ($list as &$v) {
-            $v['comment_num'] = PlatformComment::where(['first_id'=>$v['id'],'type'=>1])->count();
+            $v['comment_num'] = PressComment::where(['first_id'=>$v['id'],'type'=>1])->count();
             $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);
@@ -91,7 +91,7 @@ class Press extends Base
     {
         $sel_where[]  = ['id','=',input('get.id')];
         $detail = \app\common\model\Press::field('id,images,content,read_num,create_at,transmit_num')->where($sel_where)->find()->toArray();
-        $detail['comment_num'] = PlatformComment::where(['first_id'=>$detail['id'],'type'=>1])->count();
+        $detail['comment_num'] = PressComment::where(['first_id'=>$detail['id'],'type'=>1])->count();
         $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);
@@ -127,7 +127,7 @@ class Press extends Base
         $user_id = $this->user_id;
         $sort_type= input('sort_type',1);
         $order = $sort_type == 1 ? 'c.id desc' : 'c.like_times desc';
-        $list  =PlatformComment::where($where)
+        $list  =PressComment::where($where)
             ->alias('c')
             ->field('c.*,u.name,u.headimg')
             ->leftJoin('store_member u','u.id = c.user_id')
@@ -136,7 +136,7 @@ class Press extends Base
             ->select()->toArray();
 
         array_walk($list,function (&$val,$k)use($user_id){
-            $children = PlatformComment::where(['c.pid'=>$val['id'],'c.is_deleted'=>0])
+            $children = PressComment::where(['c.pid'=>$val['id'],'c.is_deleted'=>0])
                 ->alias('c')->field('c.*,u.name,u.headimg')
                 ->leftJoin('store_member u','u.id = c.user_id')
                 ->order('c.id asc')
@@ -144,13 +144,13 @@ class Press extends Base
             $val['children'] =  $children;
             $val['like_num'] = PlatformLike::getPraiseNum($val['id']);
             $val['is_like'] =  PlatformLike::where(['like_id'=>$val['id'],'user_id'=>$user_id,'type'=>1])->count();
-            $parent  = PlatformComment::where(['c.id'=>$val['pid'],'c.is_deleted'=>0])
+            $parent  = PressComment::where(['c.id'=>$val['pid'],'c.is_deleted'=>0])
                 ->alias('c')->field('c.*,u.name,u.headimg')
                 ->leftJoin('store_member u','u.id = c.user_id')
                 ->find();
             $val['parent']  = $parent ? $parent->toArray() : null;
         });
-        $total_num  = PlatformComment::where($where)->alias('c')->count();
+        $total_num  = PressComment::where($where)->alias('c')->count();
         $this->success('ok',['list'=>$list,'total_num'=>$total_num]);
     }
 
@@ -164,7 +164,7 @@ class Press extends Base
      * @param name:id type:int default:1 desc:评论id
      */
     public function delComment(){
-        PlatformComment::where(['id'=>input('post.id'),'user_id'=>$this->user_id])->update(['is_deleted'=>1]);
+        PressComment::where(['id'=>input('post.id'),'user_id'=>$this->user_id])->update(['is_deleted'=>1]);
         $this->success('删除成功');
     }
     
@@ -259,8 +259,8 @@ class Press extends Base
         $id = input('post.id');
         $content = input('post.content',0);
         if(!$content) $this->error('请输入评论内容');
-        $res = PlatformComment::create(['user_id'=>$this->user_id,'content'=>$content,'first_id'=>$id,'type'=>1]);
-        $detail  =PlatformComment::where('p.id',$res->id)
+        $res = PressComment::create(['user_id'=>$this->user_id,'content'=>$content,'first_id'=>$id,'type'=>1]);
+        $detail  =PressComment::where('p.id',$res->id)
             ->alias('p')
             ->field('p.id,p.content,p.create_at,u.name,u.headimg')
             ->leftJoin('store_member u','u.id = c.user_id')
@@ -273,7 +273,7 @@ class Press extends Base
      * @desc 新闻二级评论
      * @author qc
      * @method POST
-     * @url /api/Press/pressCommend
+     * @url /api/Press/pressSecondComment
      * @header name:Authorization require:1 desc:Token
      * @param name:id type:int default:1 desc:评论id
      * @param name:content type:string default:-- desc:内容
@@ -281,9 +281,9 @@ class Press extends Base
      * @return name:headimg type:string default:-- desc:会员头像
      * @return name:content type:string default:-- desc:内容
      */
-    public function pressCommend()
+    public function pressSecondComment()
     {
-        $comment = PlatformComment::where('id',input('post.id'))->find()->toArray();
+        $comment = PressComment::where('id',input('post.id'))->find()->toArray();
         unset($comment['id']);
         unset($comment['create_at']);
         $comment['pid'] = input('post.id');
@@ -291,8 +291,8 @@ class Press extends Base
         $comment['content'] = input('post.content');
         $comment['lev']++;
         if(!$comment['source_id']) $comment['source_id'] = input('post.id');
-        $res = PlatformComment::create($comment);
-        $detail  = PlatformComment::where('p.id',$res->id)
+        $res = PressComment::create($comment);
+        $detail  = PressComment::where('p.id',$res->id)
             ->alias('p')
             ->field('p.id,p.content,p.create_at,u.name,u.headimg')
             ->leftJoin('store_member u','u.id = c.user_id')

+ 2 - 2
application/common/model/PlatformComment.php → application/common/model/PressComment.php

@@ -1,8 +1,8 @@
 <?php
 namespace app\common\model;
 use think\Model;
-// 平台评论
-class PlatformComment extends Model
+// 新闻评论
+class PressComment extends Model
 {
 
 }