lizhen_gitee 11 months ago
parent
commit
61c767199f

+ 28 - 28
addons/faredis/config.php

@@ -2,43 +2,43 @@
 
 
 return [
 return [
     [
     [
-        'name'    => 'host',
-        'title'   => '主机',
-        'type'    => 'string',
+        'name' => 'host',
+        'title' => '主机',
+        'type' => 'string',
         'content' => [],
         'content' => [],
-        'value'   => '127.0.0.1',
-        'rule'    => 'required',
-        'extend'  => '',
-        'tip'     => ''
+        'value' => '127.0.0.1',
+        'rule' => 'required',
+        'extend' => '',
+        'tip' => '',
     ],
     ],
     [
     [
-        'name'    => 'port',
-        'title'   => '端口',
-        'type'    => 'string',
+        'name' => 'port',
+        'title' => '端口',
+        'type' => 'string',
         'content' => [],
         'content' => [],
-        'value'   => '6379',
-        'rule'    => 'required',
-        'extend'  => '',
-        'tip'     => ''
+        'value' => '6379',
+        'rule' => 'required',
+        'extend' => '',
+        'tip' => '',
     ],
     ],
     [
     [
-        'name'    => 'password',
-        'title'   => '密码',
-        'type'    => 'string',
+        'name' => 'password',
+        'title' => '密码',
+        'type' => 'string',
         'content' => [],
         'content' => [],
-        'value'   => '',
-        'rule'    => '',
-        'extend'  => '',
-        'tip'     => ''
+        'value' => '',
+        'rule' => '',
+        'extend' => '',
+        'tip' => '',
     ],
     ],
     [
     [
-        'name'    => 'dbnums',
-        'title'   => '库数量',
-        'type'    => 'string',
+        'name' => 'dbnums',
+        'title' => '库数量',
+        'type' => 'string',
         'content' => [],
         'content' => [],
-        'value'   => '16',
-        'rule'    => '',
-        'extend'  => '',
-        'tip'     => ''
+        'value' => '16',
+        'rule' => '',
+        'extend' => '',
+        'tip' => '',
     ],
     ],
 ];
 ];

+ 1 - 1
application/admin/lang/zh-cn/usergreet.php

@@ -8,7 +8,7 @@ return [
     'Type 2'        => '图片',
     'Type 2'        => '图片',
     'Title'         => '文字',
     'Title'         => '文字',
     'Image'         => '图片',
     'Image'         => '图片',
-    'Status'        => '实名认证',
+    'Status'        => '状态',
     'Status 0'      => '待审核',
     'Status 0'      => '待审核',
     'Status 1'      => '审核通过',
     'Status 1'      => '审核通过',
     'User.username' => '用户名'
     'User.username' => '用户名'

+ 48 - 16
application/api/controller/Greet.php

@@ -29,10 +29,20 @@ class Greet extends Api
         $this->success(1,$list);
         $this->success(1,$list);
     }
     }
 
 
-    //我的打招呼列表
+    //我的打招呼列表,自己看所有的
     public function get_greet(){
     public function get_greet(){
         $type = input('type',1);
         $type = input('type',1);
 
 
+        $list = Db::name('user_greet')->where('user_id',$this->auth->id)->where('type',$type)->select();
+        $list = list_domain_image($list,['image']);
+
+        $this->success(1,$list);
+    }
+
+    //我的打招呼列表,对外的已过审的
+    public function get_greet_checked(){
+        $type = input('type',1);
+
         $list = Db::name('user_greet')->where('user_id',$this->auth->id)->where('type',$type)->where('status',1)->select();
         $list = Db::name('user_greet')->where('user_id',$this->auth->id)->where('type',$type)->where('status',1)->select();
         $list = list_domain_image($list,['image']);
         $list = list_domain_image($list,['image']);
 
 
@@ -41,6 +51,14 @@ class Greet extends Api
 
 
     //添加打招呼
     //添加打招呼
     public function add_greet(){
     public function add_greet(){
+
+        if($this->auth->gender == 1 && $this->auth->idcard_status != 1){
+            $this->error('请先完成实名认证');
+        }
+        if($this->auth->gender == 0 && $this->auth->real_status != 1){
+            $this->error('请先完成真人认证');
+        }
+
         $type = input('type',1);
         $type = input('type',1);
         $title = input('title','');
         $title = input('title','');
         $image = input('image','');
         $image = input('image','');
@@ -73,30 +91,44 @@ class Greet extends Api
         $this->success();
         $this->success();
     }
     }
 
 
-    //女性打个招呼
+    //一键搭讪
     public function once_greet(){
     public function once_greet(){
 
 
-        $type1 = Db::name('user_greet')->where('user_id',$this->auth->id)->where('status',1)->where('type',1)->orderRaw('rand()')->find();
+        if($this->auth->gender == 1){
+
+            $today = strtotime(date('Y-m-d'));
+            $end = $today + 86399;
+            $apiLimitTime = $end - time();
 
 
+            $times = config('site.man_dashan_times') ?: 50;
+            $rs = $this->apiLimit($times,$apiLimitTime*1000);
+            if(!$rs){
+                $this->error('今日搭讪次数已用完');
+            }
 
 
-        $type2 = Db::name('user_greet')->where('user_id',$this->auth->id)->where('status',1)->where('type',2)->orderRaw('rand()')->find();
-        $type2 = info_domain_image($type2,['image']);
 
 
-        $result = [
-            'chat' => !empty($type1) ? $type1['title'] : '',
-            'image' => !empty($type2) ? $type2['image'] : '',
-        ];
+            $where['gender'] = ['IN',[1,2]];
+            $chat = Db::name('greet_sys')->field('id,title')->where($where)->orderRaw('rand()')->find();
+            $result = [
+                'chat' => !empty($chat) ? $chat['title'] : '',
+                'image' => '',
+            ];
 
 
-        if($this->auth->gender == 1){
-            $result['image'] = '';
-        }
+        }else{
+            $type1 = Db::name('user_greet')->where('user_id',$this->auth->id)->where('status',1)->where('type',1)->orderRaw('rand()')->find();
 
 
-        $this->success(1,$result);
-    }
+            $type2 = Db::name('user_greet')->where('user_id',$this->auth->id)->where('status',1)->where('type',2)->orderRaw('rand()')->find();
+            $type2 = info_domain_image($type2,['image']);
+
+            $result = [
+                'chat' => !empty($type1) ? $type1['title'] : '',
+                'image' => !empty($type2) ? $type2['image'] : '',
+            ];
+
+        }
 
 
-    //首页一键搭讪
-    public function onekey_greet(){
 
 
+        $this->success(1,$result);
     }
     }
 
 
 
 

+ 2 - 0
application/api/controller/Index.php

@@ -160,4 +160,6 @@ class Index extends Api
 
 
 
 
 
 
+
+
 }
 }

+ 1 - 1
application/api/controller/User.php

@@ -348,7 +348,7 @@ class User extends Api
         }
         }
 
 
         //视频,需要审核
         //视频,需要审核
-        $user_audit_switch = config('site.user_audit_switch');
+        $user_audit_switch = 1;
         if(isset($data['video_bio']) && !empty($data['video_bio']) && $user_audit_switch == 1){
         if(isset($data['video_bio']) && !empty($data['video_bio']) && $user_audit_switch == 1){
 
 
             $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','video_bio')->where('status',0)->find();
             $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','video_bio')->where('status',0)->find();

+ 1 - 1
application/extra/site.php

@@ -68,7 +68,6 @@ return array (
 使用方法:
 使用方法:
 1、青少年模式开启后会立即生效,需要输入密码关闭青少年模式才能继续使用。
 1、青少年模式开启后会立即生效,需要输入密码关闭青少年模式才能继续使用。
 2、青少年模式开启后,每次登录或重启应用均需要输入密码,关闭后才能正常使用APP。',
 2、青少年模式开启后,每次登录或重启应用均需要输入密码,关闭后才能正常使用APP。',
-  'user_audit_switch' => '1',
   'fangzhapian' => '以下行为一经发现,平台将严肃处理 
   'fangzhapian' => '以下行为一经发现,平台将严肃处理 
 1、以交友/网恋等为由诱导发生任何形式的金钱来往
 1、以交友/网恋等为由诱导发生任何形式的金钱来往
 2、添加联系方式后,线下要求转账/发红包/代付款等行为
 2、添加联系方式后,线下要求转账/发红包/代付款等行为
@@ -113,4 +112,5 @@ return array (
 2.不同等级可解锁不同权限',
 2.不同等级可解锁不同权限',
   'apisite_switch' => '1',
   'apisite_switch' => '1',
   'apisite_notice' => '全站维护中!!',
   'apisite_notice' => '全站维护中!!',
+  'man_dashan_times' => '20',
 );
 );