Ethan преди 6 години
родител
ревизия
12b5484425

+ 35 - 1
application/user/controller/All.php

@@ -21,7 +21,41 @@ class All extends UserControl
      */
     public function index()
     {
-        $userId = session('admin_id');
+        $userId = session('user_id');
+        $userInfo = model('user')->getUserInfo($userId);
+        $this->assign('userInfo', $userInfo);
+        $userId = session('user_id');
+        $countProduct = model('userproduct')->getProductCount($userId);
+        $this->assign('countProduct', $countProduct);
+        $renewProduct = model('userproduct')->getRenewProductCount($userId);
+        $this->assign('renewProduct', $renewProduct);
+
+        $setup_date = config('setup_date');
+        $statistics['os'] = PHP_OS;
+        $statistics['web_server'] = $_SERVER['SERVER_SOFTWARE'];
+        $statistics['php_version'] = PHP_VERSION;
+        $statistics['sql_version'] = $this->_mysql_version();
+        $statistics['setup_date'] = substr($setup_date, 0, 10);
+
+        $statistics['domain'] = $_SERVER['HTTP_HOST'];
+        $statistics['ip'] = GetHostByName($_SERVER['SERVER_NAME']);
+        $statistics['zlib'] = function_exists('gzclose') ? 'YES' : 'NO'; //zlib
+        $statistics['safe_mode'] = (boolean)ini_get('safe_mode') ? 'YES' : 'NO'; //safe_mode = Off
+        $statistics['timezone'] = function_exists("date_default_timezone_get") ? date_default_timezone_get() : "no_timezone";
+        $statistics['curl'] = function_exists('curl_init') ? 'YES' : 'NO';
+        $statistics['fileupload'] = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknown';
+        $statistics['max_ex_time'] = @ini_get("max_execution_time") . 's'; //脚本最大执行时间
+        $statistics['set_time_limit'] = function_exists("set_time_limit") ? true : false;
+        $statistics['memory_limit'] = ini_get('memory_limit');
+        $statistics['version'] = file_get_contents(APP_PATH . 'version.php');
+        if (function_exists("gd_info")) {
+            $gd = gd_info();
+            $statistics['gdinfo'] = $gd['GD Version'];
+        } else {
+            $statistics['gdinfo'] = lang('Unknown');
+        }
+
+        $this->assign('statistics', $statistics);
 
         return $this->fetch('index');
     }

+ 7 - 0
application/user/lang/zh-cn/index.lang.php

@@ -18,6 +18,13 @@ $lang['index_modifypw_fail'] ='密码修改失败';
 //版本信息
 $lang['wel_version_info'] ='版本信息';
 $lang['all_user_info'] ='用户信息';
+$lang['all_uncertified'] ='未认证';
+$lang['all_money'] ='账户余额(元)';
+$lang['all_recharge'] ='充值';
+$lang['all_holding_products'] ='持有产品(项)';
+$lang['all_view_orders'] ='查看订单';
+$lang['all_renew'] ='可续费';
+$lang['all_view_renew_orders'] ='查看续费订单';
 $lang['wel_version'] ='版本';
 $lang['wel_install_date'] ='安装时间';
 $lang['wel_program_development'] ='程序开发';

+ 22 - 0
application/user/model/User.php

@@ -0,0 +1,22 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class User extends Model
+{
+    public function getUserInfo($userId)
+    {
+        $result = $this
+            ->alias('a')
+            ->join('userinfo b', 'a.user_id = b.user_id')
+            ->where(['a.user_id' => $userId])
+            ->find();
+
+        return $result;
+    }
+
+}

+ 34 - 0
application/user/model/UserInfo.php

@@ -0,0 +1,34 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 主页导航管理模型
+ */
+class User extends Model
+{
+
+
+    /**
+     * 主页文字获取
+     *
+     * @access public
+     * @param mixed $field 查询字段
+     * @param mixed $where 条件
+     * @param mixed $order 排序
+     * @return array 返回类型
+     */
+    public function getSelect($field, $where=[], $order='product_id asc')
+    {
+        $result = $this->field($field);
+        if (empty($where) === false) {
+            $result = $result->where($where);
+        }
+
+        $result = $result->order($order)->select();
+        return $result;
+    }//endgetSelect()
+
+
+}

+ 37 - 0
application/user/model/Userproduct.php

@@ -0,0 +1,37 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Userproduct extends Model
+{
+    public function getProductCount($userId)
+    {
+        $result = $this
+            ->where(['user_id' => $userId])
+            ->count();
+
+        return $result;
+    }
+    public function getRenewProductCount($userId)
+    {
+        $allData = $this
+            ->field(['userProduct_dayNumber', 'userProduct_buyTime'])
+            ->where(['user_id' => $userId])
+            ->select();
+        $count = 0;
+        foreach ($allData as $key => $value) {
+            $numberDay = $value->userProduct_dayNumber - 15;
+            $remindDate = date("Y-m-d",strtotime($numberDay . " day"));
+            if ($value->userProduct_buyTime >= $remindDate) {
+                $count++;
+            }
+        }
+
+        return $count;
+    }
+
+}

+ 9 - 8
application/user/view/all/index.html

@@ -3,22 +3,23 @@
 <div class="layui-tab-content page-tab-content">
     <div style="width: 35%; float: left">
         <div>
-            <img src="">
-            {$Think.session.admin_name}
+            <img src="{$Think.USER_SITE_ROOT}/images/header.png" style="width: 50px; height: 50px; border-radius:50%">
+            <span style="margin-left: 20px; font-size: 20px">{$Think.session.user_email}</span>
+            <a href="" style="margin-left: 20px; font-size: 18px">{$Think.lang.all_uncertified}</a>
         </div>
         <table class="layui-table lay-even">
             <tbody>
             <tr>
-                <td class="gray_bg">{$Think.lang.wel_version}</td>
-                <td>{$statistics['version']}</td>
+                <td>{$Think.lang.all_money}</td>
+                <td>{$userInfo->userInfo_money}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_recharge}</a></td>
             </tr>
             <tr>
-                <td class="gray_bg">{$Think.lang.wel_program_development}</td>
-                <td>{$Think.lang.wel_deshangwangluo}</td>
+                <td>{$Think.lang.all_holding_products}</td>
+                <td>{$countProduct}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_view_orders}</a></td>
             </tr>
             <tr>
-                <td class="gray_bg">{$Think.lang.wel_aboutus_website}</td>
-                <td><a href="http://www.csdeshang.com" target="_blank">{$Think.lang.aboutus_website}</a></td>
+                <td>{$Think.lang.all_renew}</td>
+                <td>{$renewProduct}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_view_renew_orders}</a></td>
             </tr>
             </tbody>
         </table>

+ 2 - 1
application/user/view/index/index.html

@@ -59,7 +59,8 @@
             <!--<a href="javascript:dsLayerConfirm('{:url('Index/clear')}','{$Think.lang.ds_clear_cache_confirm}')">{$Think.lang.ds_shop_car}</a>-->
             <a style="font-size: 16px; color: black" href="javascript:dsLayerConfirm('{:url('Index/clear')}')">{$Think.lang.ds_shop_car}</a>
             <a style="font-size: 16px; color: black; margin-left: 20px" href="javascript:dsLayerConfirm('{:url('Index/clear')}')">{$Think.lang.support_services}</a>
-            <a style="font-size: 16px; color: black; margin-left: 20px; margin-right: 20px" href="javascript:dsLayerConfirm('{:url('Index/clear')}')">{$Think.session.admin_name}</a>
+            <a style="font-size: 16px; color: black; margin-left: 20px;" href="javascript:dsLayerConfirm('{:url('Index/clear')}')">{$Think.session.user_email}</a>
+            <a style="font-size: 16px; color: black; margin-left: 20px; margin-right: 20px" href="{:url('Login/logout')}">{$Think.lang.ds_safe_withdrawing}</a>
         </ul>
     </div>
 </div>

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
public/static/user/css/layui.css


BIN
public/static/user/images/header.png


Някои файлове не бяха показани, защото твърде много файлове са промени