fix many foolish bugs

This commit is contained in:
printempw 2016-07-24 14:56:22 +08:00
parent 115b12029a
commit ea4faf6e33
4 changed files with 8 additions and 5 deletions

View File

@ -188,6 +188,7 @@ class User
$user->password = $this->cipher->encrypt($password, $_ENV['SALT']);
$user->ip = $ip;
$user->score = \Option::get('user_initial_score');
$user->register_at = \Utils::getTimeFormatted();
$user->last_sign_at = \Utils::getTimeFormatted(time() - 86400);
$user->permission = 0;
$user->save();
@ -195,7 +196,6 @@ class User
$closet = new ClosetModel();
$closet->uid = $user->uid;
$closet->textures = "";
$closet->amount = 0;
$closet->save();
$this->eloquent_model = $user;

4
db.sql
View File

@ -2,7 +2,7 @@
* @Author: printempw
* @Date: 2016-07-24 13:37:40
* @Last Modified by: printempw
* @Last Modified time: 2016-07-24 13:48:50
* @Last Modified time: 2016-07-24 14:49:24
*/
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@ -103,7 +103,7 @@ INSERT INTO `options` (`id`, `option_name`, `option_value`) VALUES
(1, 'site_url', ''),
(2, 'site_name', 'Blessing Skin'),
(3, 'site_description', '开源的 PHP Minecraft 皮肤站'),
(4, 'user_can_register', '0'),
(4, 'user_can_register', '1'),
(5, 'regs_per_ip', '3'),
(6, 'api_type', '0'),
(7, 'announcement', '欢迎使用 Blessing Skin Server 3.0'),

View File

@ -10,6 +10,9 @@ define('BASE_DIR', __DIR__);
// Autoloader
require BASE_DIR.'/vendor/autoload.php';
if (!file_exists(BASE_DIR."/.env"))
exit('错误:.env 配置文件不存在');
// Load dotenv configuration
$dotenv = new \Dotenv\Dotenv(BASE_DIR);
$dotenv->load();

View File

@ -24,7 +24,7 @@
<div class="row">
<div class="col-md-6">
<div class="info-box">
<a href="../admin/user">
<a href="../admin/users">
<span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">注册用户</span>
@ -36,7 +36,7 @@
<div class="col-md-6">
<div class="info-box">
<a href="../admin/player">
<a href="../admin/players">
<div class="info-box-content" style="margin-left: 0;">
<span class="info-box-text">角色总数</span>
<span class="info-box-number">{{ App\Models\PlayerModel::all()->count() }}</span>