root 5 years ago
parent
commit
8b06636572
3 changed files with 8 additions and 3 deletions
  1. 3 1
      app/Http/Controllers/UserController.php
  2. 2 1
      install.sql
  3. 3 1
      update.sql

+ 3 - 1
app/Http/Controllers/UserController.php

@@ -56,7 +56,9 @@ class UserController extends Controller
                 'is_admin',
                 'remind_expire',
                 'remind_traffic',
-                'expired_at'
+                'expired_at',
+                'balance',
+                'commission_balance'
             ])
             ->first();
         $user['avatar_url'] = 'https://cdn.v2ex.com/gravatar/' . md5($user->email) . '?s=64&d=identicon';

+ 2 - 1
install.sql

@@ -105,6 +105,7 @@ CREATE TABLE `v2_user` (
   `invite_user_id` int(11) DEFAULT NULL,
   `email` varchar(64) NOT NULL,
   `password` varchar(64) NOT NULL,
+  `balance` int(11) NOT NULL DEFAULT '0',
   `commission_rate` int(11) DEFAULT NULL,
   `commission_balance` int(11) NOT NULL DEFAULT '0',
   `t` int(11) NOT NULL DEFAULT '0',
@@ -132,4 +133,4 @@ CREATE TABLE `v2_user` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
--- 2019-11-27 11:46:36
+-- 2019-11-28 17:14:25

+ 3 - 1
update.sql

@@ -15,4 +15,6 @@ ALTER TABLE `v2_order`
 ADD `type` int(11) NOT NULL COMMENT '1新购2续费3升级' AFTER `plan_id`;
 /* 2019-11-27 */
 ALTER TABLE `v2_user`
-ADD `commission_rate` int(11) NULL AFTER `password`;
+ADD `commission_rate` int(11) NULL AFTER `password`;
+ALTER TABLE `v2_user`
+ADD `balance` int(11) NOT NULL DEFAULT '0' AFTER `password`;