chuweiqiang 11 月之前
父节点
当前提交
865f89a2be
共有 2 个文件被更改,包括 10 次插入5 次删除
  1. 3 3
      .idea/workspace.xml
  2. 7 2
      application/operate/controller/Forum.php

+ 3 - 3
.idea/workspace.xml

@@ -598,7 +598,7 @@
       <workItem from="1714091498498" duration="11116000" />
       <workItem from="1714109915098" duration="14739000" />
       <workItem from="1714177835625" duration="26205000" />
-      <workItem from="1714351055428" duration="4929000" />
+      <workItem from="1714351055428" duration="6780000" />
     </task>
     <servers />
   </component>
@@ -732,10 +732,10 @@
       <screen x="0" y="0" width="2194" height="1194" />
     </state>
     <state x="827" y="411" key="NewPhpClassDialog/0.0.2194.1194@0.0.2194.1194" timestamp="1710897647768" />
-    <state x="310" y="130" width="1206" height="901" key="find.popup" timestamp="1714354461242">
+    <state x="310" y="130" width="1206" height="901" key="find.popup" timestamp="1714358131767">
       <screen x="0" y="0" width="2194" height="1194" />
     </state>
-    <state x="310" y="130" width="1206" height="901" key="find.popup/0.0.2194.1194@0.0.2194.1194" timestamp="1714354461242" />
+    <state x="310" y="130" width="1206" height="901" key="find.popup/0.0.2194.1194@0.0.2194.1194" timestamp="1714358131767" />
     <state x="1355" y="482" width="672" height="579" key="search.everywhere.popup" timestamp="1712106083717">
       <screen x="0" y="0" width="2194" height="1194" />
     </state>

+ 7 - 2
application/operate/controller/Forum.php

@@ -232,9 +232,11 @@ class Forum extends Controller
             $data['is_new'] = 0;
             $service_phone = Db::name('system_config')->where('name','service_phone')->value('value');
             $user_id  = User::where('phone',$service_phone)->value('id');
+            if($this->request->action() == 'add'){
             if($user_id){
                 $data['user_id'] = $user_id;
             }
+            }
             if($data['hot_num'] != $data['hot_num_old']) $data['hot_time'] = date("Y-m-d H:i:s");
             //定时热搜
             if(!$post['hot_num']){
@@ -315,10 +317,13 @@ class Forum extends Controller
                 'issue_user'=>$issue_user,
                 'forum_id'=>$id
             ];
-            if($user_id){
-                $arr['user_id'] = $user_id;
+            if($this->request->action() == 'add'){
+                if($user_id){
+                    $arr['user_id'] = $user_id;
+                }
             }
 
+
             if($raply_id){
                 $res = ForumReply::where('id',$raply_id)->update($arr);
             }else{