Browse Source

首页接口

lizhen_gitee 8 months ago
parent
commit
0414cb3c7d

+ 14 - 11
application/api/controller/Baseconfig.php

@@ -14,24 +14,27 @@ class Baseconfig extends Api
 
    
     public function index(){
-//        $jewelMoneyConfig = config('site.jewel_money');
-//        $jewelMoney = bcdiv(1,$jewelMoneyConfig,10);//转换为小数给前端,前端是乘以的方式计算的
         $config = [
-//            'domain_name' => config('site.domain_name'),
-//            'android_update_num' => config('site.android_update_num'),
-            'android_update_version' => config('site.android_update_version'),
-//            'ios_update_num' => config('site.ios_update_num'),
-            'ios_update_version' => config('site.ios_update_version'),
-//            'livebc_type' => Db::name('party_type')->where('room_type',2)->order('id asc')->select(),
-//            'taluopai' => config('site.taluopai'),
-//            'open_unlock_wechataccount' => config('site.open_unlock_wechataccount'),
             'no_screenshot' => config('site.no_screenshot'),
             'show_wechat_pay' => config('site.show_wechat_pay'),
             'show_ali_pay' => config('site.show_ali_pay'),
             'show_intimacy' => config('site.show_intimacy'),
-//            'jewel_money' => $jewelMoney,
         ];
 
+        //首页三个头像
+        $map = [
+            'status' => 1,
+            'is_kefu' => 0,
+            'gender' => $this->auth->gender == 1 ? 0 : 1,
+            'avatar' => ['NOTIN',[config('avatar_boy'),config('avatar_girl')]],
+        ];
+        $index_three_avatar = Db::name('user')->where($map)->where('avatar','NEQ','')->field('id,avatar')->orderRaw('rand()')->limit(3)->select();
+        $index_three_avatar = list_domain_image($index_three_avatar,['avatar']);
+        $index_three_avatar = array_column($index_three_avatar,'avatar');
+        $config['index_top_three_avatar'] = $index_three_avatar;
+
+        $config['index_top_joinnumber'] = config('site.index_top_joinnumber') + Db::name('user')->count();
+
         $this->success('success',$config);
     }
 

+ 1 - 0
application/common/model/Config.php

@@ -107,6 +107,7 @@ class Config extends Model
         $groupList =    array (
 //            'basic' => '基础配置',
             'website' => '金钱变量',
+            'withdraw' => '提现配置',
         );
         foreach ($groupList as $k => &$v) {
             $v = __($v);

+ 1 - 0
application/extra/site.php

@@ -99,4 +99,5 @@ return array (
   'rmb_to_gold' => '10',
   'withdraw_min_money' => '100',
   'new_user_intro_jewel' => '100',
+  'index_top_joinnumber' => '10000',
 );