فهرست منبع

关注通知,一键登录配置

lizhen_gitee 1 سال پیش
والد
کامیت
f3d2d87c64
2فایلهای تغییر یافته به همراه17 افزوده شده و 14 حذف شده
  1. 13 3
      application/api/controller/Usercenter.php
  2. 4 11
      application/config.php

+ 13 - 3
application/api/controller/Usercenter.php

@@ -107,7 +107,7 @@ class UserCenter extends Common
      * 添加关注
      */
     public function addFollows() {
-        $user_id = $this->request->request("user_id",0,"intval");// 关注者ID
+        $user_id = $this->request->request("user_id",0,"intval");// 关注者ID
         $type = $this->request->request("type",1);// 类型:1=关注,2=取消关注
         if (!$user_id || $user_id<=0) {
             $this->error(__('Invalid parameters'));
@@ -125,6 +125,16 @@ class UserCenter extends Common
             }
             $data["createtime"] = time();
             $id = $fansfollowModel->insertGetId($data);
+
+            //关注通知
+            $msgdata = [
+                'user_id'=>$user_id,
+                'title'  => '有人刚刚关注了你',
+                'content'=> '打开[消息][最新关注]即可查看',
+                'createtime' => time(),
+            ];
+            Db::name('message')->insertGetId($msgdata);
+
             if($id > 0) {
                 // 增加任务进度 +exp
                 \app\common\model\TaskLog::tofinish($this->auth->id,"ebxLwnXj3L",1);
@@ -234,7 +244,7 @@ class UserCenter extends Common
 
     /**
      * 获取关注列表
-     * (个人中心模块)(消息最新关注)
+     * (个人中心模块)(消息-最新关注)
      */
     public function getFollowsUser() {
         $type = $this->request->request('type',1); // 1=关注,2=粉丝
@@ -342,7 +352,7 @@ class UserCenter extends Common
      * 获取附近的人
      * (消息-同城)
      */
-    public function samecity(){
+    public function getSamecityList(){
 
         if(!$this->auth->city_id){
             $this->success(1,[]);

+ 4 - 11
application/config.php

@@ -294,14 +294,7 @@ return [
         //API接口地址
         'api_url'               => 'https://api.fastadmin.net',
     ],
-//    'redis'                  => [
-//        // 主机
-//        'host'     => '172.16.0.12',
-//        // 密码
-//        'password'     => 'bans9543',
-//        // 端口
-//        'port'      => 6379,
-//    ],
+
     'redis'                  => [
         // 主机
         'host'     => Env::get('redis.host', '127.0.0.1'),
@@ -354,11 +347,11 @@ return [
     // 运营商一键登录
     'onLogin'        => [
         //
-        'secretid'     => 'bae41209948a10b6102801ed3936c38c',
+        'secretid'     => '14a36938de908d93e1c799f09f9a8943',
         //
-        'secretkey'      => '9f49687b769b1a689db7e9448da74deb',
+        'secretkey'      => 'd88ef04221427693a16f0f9fcd270c05',
         //
-        'businessid'      => 'ff9bdf7f2ac14967a72f05c94171e8b0',
+        'businessid'      => '6af7aba2b8844b83970b37c9de2b9f82',
     ],
     // 二要素实名认证 --测试
 //    'auth'        => [