Browse Source

钱包余额获取充值配置

Panda 2 months ago
parent
commit
3ff4fe3a52

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

@@ -185,8 +185,7 @@ class Pay extends Api
     //人民币充值
     public function money_config()
     {
-        $wallet         = (new Wallet())->getWallet($this->auth->id);
-        $data['wallet'] = $wallet;
+        $data['balance'] = (new Wallet())->getWallet($this->auth->id);
         $data['recharge_explain'] = config('site.recharge_explain');
         $list           = Db::name('paymoney_config')->order('weigh asc,id asc')->where('is_show', 1)->select();
         $data['config'] = $list;

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

@@ -20,8 +20,6 @@ class Userwallet extends Api
         $this->success('success',$wallet);
     }
 
-
-
     //我的余额日志
     public function my_money_log(){
         $type = input('type',0);

+ 6 - 1
application/common/model/Wallet.php

@@ -53,7 +53,7 @@ class Wallet extends Model
      * @param string $wallet_name 指定钱包名
      * @return array|float
      */
-    public function getWallet($user_id = 0, $wallet_name = '')
+    public function getWalletBak($user_id = 0, $wallet_name = '')
     {
         //所有钱包余额
         if (!$wallet = Db::name('user_wallet')->where(['user_id' => $user_id])->find()) {
@@ -67,6 +67,11 @@ class Wallet extends Model
         }
     }
 
+    public function getWallet($user_id = 0, $wallet_name = 'money')
+    {
+        return Db::name('user')->where('id',$user_id)->value($wallet_name);
+    }
+
 
     /**
      *