lizhen_gitee преди 1 година
родител
ревизия
a161b2f211
променени са 2 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 13 0
      application/api/controller/Userfollow.php
  2. 1 1
      public/assets/js/backend/enum/tag.js

+ 13 - 0
application/api/controller/Userfollow.php

@@ -163,7 +163,14 @@ class Userfollow extends Api
     public function refuse_newfriend(){
         $id = input('msg_id',0);
 
+        $msg_info = Db::name('message')->where('id',$id)->find();
         Db::name('message')->where('id',$id)->update(['status'=>1]);
+
+        //拒绝给个消息
+        if($msg_info['infotype'] == 'newfriend' && !empty($msg_info['infotype_id'])){
+            $msg_id = \app\common\model\Message::addMessage($msg_info['infotype_id'],'好友申请被拒绝',$this->auth->nickname.'拒绝了您的好友请求');
+        }
+
         $this->success('已拒绝');
     }
 
@@ -171,6 +178,7 @@ class Userfollow extends Api
     //关注某人
     public function follow_one(){
         $follow_uid = input('follow_uid',0);
+        $msg_id = input('msg_id',0);
         if(!$follow_uid){
             $this->error(__('Invalid parameters'));
         }
@@ -223,6 +231,11 @@ class Userfollow extends Api
             Db::name('message')->insertGetId($message);
         }
 
+        //我从好友审核列表过来的,我又回关了
+        if(!empty($msg_id)){
+            $msg_id = \app\common\model\Message::addMessage($follow_uid,'好友申请已通过',$this->auth->nickname.'同意了您的好友请求');
+        }
+
         
 
         Db::commit();

+ 1 - 1
public/assets/js/backend/enum/tag.js

@@ -8,7 +8,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     index_url: 'enum/tag/index' + location.search,
                     add_url: 'enum/tag/add',
                     edit_url: 'enum/tag/edit',
-//                    del_url: 'enum/tag/del',
+                    del_url: 'enum/tag/del',
                     multi_url: 'enum/tag/multi',
                     import_url: 'enum/tag/import',
                     table: 'enum_tag',