Browse Source

修复接口

lizhen_gitee 3 years ago
parent
commit
3b5e7716fa

+ 7 - 5
application/api/controller/Pay.php

@@ -122,11 +122,13 @@ class Pay extends Api
         }
 
         //赋值money
-        $recharge_config = Db::name('paygold_config')->where('id',$rc_id)->find();
-        $money = $recharge_config['money'] ?: 0;
-        $gold  = $recharge_config['gold'] ?: 0;
-        $first_gold     = $recharge_config['first_gold'] ?: 0;
-        $first_vipdays  = $recharge_config['first_vipdays'] ?: 0;
+        if($rc_id){
+            $recharge_config = Db::name('paygold_config')->where('id',$rc_id)->find();
+            $money = $recharge_config['money'] ?: 0;
+            $gold  = $recharge_config['gold'] ?: 0;
+            $first_gold     = $recharge_config['first_gold'] ?: 0;
+            $first_vipdays  = $recharge_config['first_vipdays'] ?: 0;
+        }
 
         //自由输入覆盖
         if(!empty($freemoney)){

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

@@ -265,7 +265,7 @@ class User extends Api
                 $newone = input('avatar', '', 'trim,strip_tags,htmlspecialchars');
             }
             if($field == 'photo_images'){
-                $newone = input('avatar', '', 'trim,strip_tags,htmlspecialchars');
+                $newone = input('photo_images', '', 'trim,strip_tags,htmlspecialchars');
             }
 
             $data[$field] = $newone;
@@ -287,7 +287,6 @@ class User extends Api
         if(empty($data)){
             $this->error('没有任何改变');
         }
-
         Db::name('user')->where('id',$this->auth->id)->update($data);
         $this->success();
     }

+ 2 - 0
application/common/library/Auth.php

@@ -463,6 +463,8 @@ class Auth
         $userinfo['follow_num'] = Db::name('user_follow')->where('uid',$this->id)->count('id');
         //粉丝数量
         $userinfo['fans_num'] = Db::name('user_follow')->where('follow_uid',$this->id)->count('id');
+        //签到天数
+        $userinfo['sign_times'] = $check = Db::name('user_sign')->where('uid',$this->id)->order('id desc')->value('times');