Prechádzať zdrojové kódy

wesmiler 更新第5期更新代码合并

wesmiler 4 rokov pred
rodič
commit
3523d358d6

+ 5 - 0
app/api/controller/MemberController.php

@@ -79,6 +79,11 @@ class MemberController extends BaseController
         // VIP有效状态和时间
         $vipAuth = isset($memberInfo['vip_auth']) ? intval($memberInfo['vip_auth']) : 0;
         $vipExpire = isset($memberInfo['vip_expire']) ? intval($memberInfo['vip_expire']) : 0;
+        $vipTime = isset($memberInfo['vip_time']) && $memberInfo['vip_time']? strtotime($memberInfo['vip_time']) : 0;
+        $memberInfo['vip_type'] = 1;  // 默认老VIP
+        if($vipTime > strtotime('2022-04-20 00:00:00')){
+            $memberInfo['vip_type'] = 2;
+        }
         if ($vipAuth && $vipExpire >= time()) {
             $memberInfo['vip_auth'] = 1;
             $memberInfo['vip_expire'] = date('Y-m-d', $vipExpire);

+ 11 - 7
app/weixin/model/Member.php

@@ -161,7 +161,7 @@ class Member extends Model
      */
     public static function getInfo($where, $field = "")
     {
-        $field = $field ? $field : 'id,openid,user_nickname,avatar_confirm_status,user_type,agent_type,shop_type,sign_day,sign_at,agent_status,avatar,user_login,collect_expire,lat,lng,address,real_name,redheart,is_reg_profile,mobile,balance,user_status,wechat_account as wechat_code,is_heart,vip_auth,vip_expire,vip_num,is_follow,freezing_choose';
+        $field = $field ? $field : 'id,openid,user_nickname,avatar_confirm_status,user_type,agent_type,shop_type,sign_day,sign_at,vip_time,agent_status,avatar,user_login,collect_expire,lat,lng,address,real_name,redheart,is_reg_profile,mobile,balance,user_status,wechat_account as wechat_code,is_heart,vip_auth,vip_expire,vip_num,is_follow,freezing_choose';
         $info = self::where($where)->field($field)->order('user_status desc,id desc')->find();
         return $info ? $info->toArray() : [];
     }
@@ -1431,7 +1431,7 @@ class Member extends Model
             ->field('id,openid,user_nickname,sex,real_name,is_reg_profile')
             ->find();
         $memberInfo = Member::where(['id' => $userId, 'user_type' => 2, 'user_status' => 1])
-            ->field('id,openid,user_nickname,real_name,sex,is_reg_profile,redheart,vip_auth,vip_expire,vip_num')
+            ->field('id,openid,user_nickname,real_name,sex,is_reg_profile,redheart,vip_auth,vip_time,vip_expire,vip_num')
             ->find();
         if (empty($contactInfo) || empty($memberInfo)) {
             return false;
@@ -1473,6 +1473,8 @@ class Member extends Model
         $vipAuth = isset($memberInfo['vip_auth']) ? intval($memberInfo['vip_auth']) : 0;
         $vipExpire = isset($memberInfo['vip_expire']) ? intval($memberInfo['vip_expire']) : 0;
         $vipNum = isset($memberInfo['vip_num']) ? intval($memberInfo['vip_num']) : 0;
+        $vipTime = isset($memberInfo['vip_num']) && $memberInfo['vip_time']? strtotime($memberInfo['vip_time']) : 0;
+        $vipType = $vipTime > strtotime('2022-04-20 00:00:00')? 2 : 1;
         $contactPay = $vipAuth && $vipExpire >= time() ? 0 : $contactPay;
         if ($contactPay > 0) {
             $redheart = isset($memberInfo['redheart']) ? intval($memberInfo['redheart']) : 0;
@@ -1507,8 +1509,8 @@ class Member extends Model
                 return false;
             }
         }
-        // 扣除会员微信申请次数
-        else{
+        // 扣除会员微信申请次数
+        else if ($vipType == 2){
             if ($vipNum < 1 || $vipExpire < time()) {
                 Db::rollback();
                 return 2148;
@@ -1627,13 +1629,15 @@ class Member extends Model
             return 1011;
         }
 
-        $field = 'm.redheart,m.user_nickname,m.real_name,m.openid,up.wechat_code,m.vip_num,up.qq';
+        $field = 'm.redheart,m.user_nickname,m.real_name,m.openid,up.wechat_code,m.vip_num,m.vip_time,up.qq';
         $contactUserInfo = Member::getHomeInfo($contactUid, $field, 6);
         $cOpenid = isset($contactUserInfo['openid']) ? $contactUserInfo['openid'] : '';
         $cNickname = isset($contactUserInfo['user_nickname']) ? $contactUserInfo['user_nickname'] : '';
         $redheart = isset($contactUserInfo['redheart']) ? intval($contactUserInfo['redheart']) : 0;
         $contactPay = isset($contactData['cost_redheart']) ? intval($contactData['cost_redheart']) : 0;
         $vipNum = isset($contactUserInfo['vip_num']) ? intval($contactUserInfo['vip_num']) : 0;
+        $vipTime = isset($contactUserInfo['vip_num']) && $contactUserInfo['vip_time']? strtotime($contactUserInfo['vip_time']) : 0;
+        $vipType = $vipTime > strtotime('2022-04-20 00:00:00')? 2 : 1;
         if (empty($contactUserInfo)) {
             Db::rollback();
             return 1017;
@@ -1679,8 +1683,8 @@ class Member extends Model
                 return false;
             }
         }
-        // 退还申请次数
-        else if($checkStatus == 3 || $checkStatus == 4){
+        // 新会员,退还申请次数
+        else if($vipType==2 && ($checkStatus == 3 || $checkStatus == 4)){
             $memberData = ['vip_num' => $vipNum+1, 'updated_at' => date('Y-m-d H:i:s')];
             if (!Member::where(['id' => $contactUid])->update($memberData)) {
                 Db::rollback();

+ 852 - 0
public/themes/admin_simpleboot3/user/outline/index.html

@@ -0,0 +1,852 @@
+<include file="public@header"/>
+</head>
+<body>
+<div class="wrap js-check-wrap">
+    <ul class="nav nav-tabs">
+        <li class="active"><a>
+         线下用户列表
+        </a>
+        </li>
+        <li ><a href="">
+            线下用户列表
+        </a>
+        </li>
+    </ul>
+<if condition="$Request.action eq 'custom' || $Request.param.u eq 2 || $Request.param.u eq 4">
+    <div class="qrcode">
+        <form class="well form-inline margin-top-20" method="post" onsubmit="return false;">
+        <span>生成参数</span>
+            <input class="form-control" id="url" type="text" name="url" style="width: 400px;" placeholder="请填写生成参数:如用户地址">
+            &nbsp;
+            <input type="button" class="btn btn-primary" onclick="makeQrcode()" value="生成二维码"/>
+            <span class="qrcode">
+                <a title="点击放大" data-href="">
+
+                </a>
+            </span>
+        </form>
+    </div>
+
+     </if> 
+    <if condition="$Request.action eq 'custom' || $Request.param.u eq 2">
+       <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index',array('u'=>2))}">
+    <elseif condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+      <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index',array('u'=>3))}">
+
+    <elseif condition="$Request.action eq 'screen' || $Request.param.u eq 4">
+      <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index',array('u'=>4))}">
+
+    <elseif condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">
+      <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index',array('u'=>5))}">
+
+    <else/>
+      <form class="well form-inline margin-top-20" method="post" action="{:url('user/adminIndex/index',array('u'=>1))}">
+    </if>
+        <!-- 用户ID:
+        <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
+               placeholder="请输入用户ID"> -->
+        关键字:
+        <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}" placeholder="昵称/真实姓名/手机">
+
+
+        <input type="submit" class="btn btn-primary"  value="搜索"/>
+          
+          <if condition="$Request.action eq 'custom' || $Request.param.u eq 2">
+        <a class="btn btn-default" href="{:url('user/adminIndex/index',array('u'=>2))}">清空</a>
+        
+         <elseif condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+        <a class="btn btn-default" href="{:url('user/adminIndex/index',array('u'=>3))}">清空</a>
+
+        <elseif condition="$Request.action eq 'screen' || $Request.param.u eq 4">
+          
+         <a class="btn btn-default" href="{:url('user/adminIndex/index',array('u'=>4))}">清空</a>
+
+        <elseif condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">
+          
+         <a class="btn btn-default" href="{:url('user/adminIndex/index',array('u'=>5))}">清空</a>
+
+         <else/>
+        <a class="btn btn-default" href="{:url('user/adminIndex/index',array('u'=>1))}">清空</a>
+        </if>
+
+        <if condition="$Request.action eq 'custom' || $Request.param.u eq 2">
+        <a class="btn btn-warning" href="{:url('user/adminIndex/export',array('uid'=>$Request.param.uid,'keyword'=>$Request.param.keyword,'u'=>2))}">导出</a>
+        
+        <elseif condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+             <a class="btn btn-warning" href="{:url('user/adminIndex/export',array('uid'=>$Request.param.uid,'keyword'=>$Request.param.keyword,'u'=>3))}">导出</a>
+        <elseif condition="$Request.action eq 'screen' || $Request.param.u eq 4">     
+             <a class="btn btn-warning" href="{:url('user/adminIndex/export',array('uid'=>$Request.param.uid,'keyword'=>$Request.param.keyword,'u'=>4))}">导出</a>
+       <elseif condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">     
+             <a class="btn btn-warning" href="{:url('user/adminIndex/export',array('uid'=>$Request.param.uid,'keyword'=>$Request.param.keyword,'u'=>5))}">导出</a>
+
+        <else/>
+         <a class="btn btn-warning" href="{:url('user/adminIndex/export',array('uid'=>$Request.param.uid,'keyword'=>$Request.param.keyword,'u'=>1))}">导出</a>
+       </if>
+
+        <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
+        <!-- <a class="btn btn-danger" href="{:url('user/adminIndex/index')}" style="border-color:#7349B8;background-color:#7349B8">已冻结的用户</a> -->
+
+        <a class="btn btn-danger"  id="showcho" style="border-color:#7349B8;background-color:#7349B8">条件筛选</a>
+
+        <div id="showchoice" style="display: none;  margin-top: 10px;">
+          <php>$educationarray=array(1=>'大专',2=>'本科',3=>'硕士',4=>'博士');</php>
+          <php>$marriedarray=array(1=>'未婚',2=>'离异',3=>'离异有孩子');</php>
+          <php>$propertyarray=array(0=>'无',1=>'有房',2=>'有车',3=>'有房有车');</php>
+          <php>$agearray=array('1975','1976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','1990','1991','1992','1993','1994','1995','1996','1997','1998','1999','2000');</php>
+          <php>$sexarray=array(1=>'男',2=>'女');</php>
+        <div>
+            
+              <div style="margin-top: 10px;"> 
+            <!--  年龄: <input class="form-control js-bootstrap-datetime" type="text" name="age1" style="width: 150px;margin-right:10px;" value="" placeholder="请选择年龄"> 
+             <font style="color: red">至</font> &nbsp;
+                 <input class="form-control js-bootstrap-datetime" type="text" name="age2" style="width: 150px;margin-right:25px;" value="" placeholder="请选择年龄">  -->
+              年龄: <select class="form-control" name="age1" id="age1" style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择年龄--</option>
+                    <volist name="$agearray" id="vo">
+                        <option value="{$vo}">{$vo}</option>
+                    </volist>
+                </select> 
+             <font style="color: red">至</font> &nbsp;
+                 <select class="form-control" name="age2" id="age2" style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择年龄--</option>
+                    <volist name="$agearray" id="vo">
+                        <option value="{$vo}">{$vo}</option>
+                    </volist>
+                </select>
+
+            身高: <select class="form-control" name="height" id="height"  style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择身高--</option>
+                  
+                </select>
+            <font style="color: red">至</font> &nbsp;
+                <select class="form-control" name="heightt" id="heightt"  style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择身高--</option>
+                   
+                </select>
+            
+            
+           
+
+        </div>
+        <div style="margin-top: 10px;">       
+
+            <!--<select class="form-control" name="education" id="education" style="width: 150px;margin-right:10px;">
+                    <option value="none">&#45;&#45;请选择学历&#45;&#45;</option>
+                    <volist name="$educationarray" id="vo">
+                        <option value="{$key}">{$vo}</option>
+                    </volist>
+                </select>-->
+            职业: 
+              <select class="form-control" name="occupation" style="margin-right: 15px;width: 150px;" id="position1">
+                    <option value="none">--请选择职位--</option>
+                </select>
+
+            收入: <select class="form-control" name="salary" id="salary"  style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择收入--</option>
+                    <option value="1">5-10w</option>
+                    <option value="2">10-20w</option>
+                    <option value="3">20-35w</option>
+                    <option value="4">35-55w</option>
+                    <option value="5">100w以上</option>
+                </select>
+                        
+             资产: <select class="form-control" name="property" id="property" style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择资产--</option>
+                    <volist name="$propertyarray" id="vo">
+                        <option value="{$key}">{$vo}</option>
+                    </volist>  
+                 </select>   
+
+                      
+         </div>
+            <div style="margin-top: 10px;" class="auto">
+                学历:
+                <volist name="$educationarray" id="vo" key="k">
+                    <label for="education{$k}">
+                        <input  type="checkbox" name="education[]" id="education{$k}" value="{$k}" >{$vo}
+                    </label>
+                </volist>
+                <span style="margin-left: 15px;"></span>
+                家乡:
+                <label for="home">
+                    <input type="radio" id="home" name="home" value="0"  checked>自定义
+                </label>
+                <label for="home1">
+                    <input type="radio" id="home1" name="home" value="1" >广西区内
+                </label>
+                <label for="home2">
+                    <input type="radio" id="home2" name="home" value="2">广西区外
+                </label>
+                <input class="form-control" type="text" name="home_city" style="width: 150px;margin-right:10px;" value="" placeholder="请输入省/市">
+
+            </div>
+           <div style="margin-top: 10px;">
+
+            居住地: <input class="form-control" type="text" name="city" style="width: 150px;margin-right:10px;" value="" placeholder="请输入市">
+           
+                婚姻状况: <select class="form-control" name="married" id="married" style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择婚姻--</option>
+                    <volist name="$marriedarray" id="vo">
+                        <option value="{$key}">{$vo}</option>
+                    </volist>
+                </select>
+
+                  
+                 性别: <select class="form-control" name="sex" id="sex" style="width: 150px;margin-right:10px;">
+                    <option value="none">--请选择性别--</option>
+                    <volist name="$sexarray" id="vo">
+                        <option value="{$key}">{$vo}</option>
+                    </volist>
+                </select>
+                   实名: <select class="form-control" name="idcard" id="idcard" style="width: 150px;margin-right:10px;">
+                   <option value="0">--请选择实名--</option>
+                   <option value="1">已实名</option>
+                   <option value="2">未实名</option>
+               </select>
+                 <a class="btn btn-warning" style=" padding: 3px 10px; border-color:#ca1883;background-color:#ca1883;color: #fff" id="nonecho">隐藏</a>
+           </div>
+
+            
+        </div> 
+       
+       </div>
+
+    </form>
+    <form method="post" class="js-ajax-form">
+    <div class="table-actions">
+       
+         
+         <if condition="$Request.action eq 'custom' || $Request.param.u eq 2">
+            
+            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
+                    data-action="{:url('AdminIndex/tovip',array('no'=>0))}" data-subcheck="true">取消VIP
+            </button> 
+          <elseif condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+          
+          <elseif condition="$Request.action eq 'screen' || $Request.param.u eq 4">
+            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
+                    data-action="{:url('AdminIndex/toscreen',array('no'=>0))}" data-subcheck="true">取消筛选用户
+            </button> 
+
+            <elseif condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">
+               <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
+                    data-action="{:url('AdminIndex/touserlogout',array('yes'=>1))}" data-subcheck="true">清除身份信息
+            </button>     
+
+           <else/>
+              <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
+                    data-action="{:url('AdminIndex/tovip',array('yes'=>1))}" data-subcheck="true">成为VIP
+            </button>
+
+              <button class="btn btn-primary btn-sm js-ajax-submit" style="" type="submit" data-action="{:url('AdminIndex/totuijian',array('yes'=>1))}" onclick="return confirm('确定要成为单身推荐吗?')" data-subcheck="true">成为单身推荐
+            </button>
+
+             <button class="btn btn-primary btn-sm js-ajax-submit" style="" type="submit" data-action="{:url('AdminIndex/toscreen',array('yes'=>1))}" onclick="return confirm('确定要成为筛选用户吗?')" data-subcheck="true">成为筛选用户
+              </button>
+                <button class="btn btn-primary btn-sm" type="button"  onclick="doMove()"> 标记到售前公海
+                </button>
+              <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
+                    data-action="{:url('AdminIndex/tozhuxiao',array('yes'=>1))}" onclick="return confirm('确定要成为注销吗?')" data-subcheck="true">
+                    注销
+              </button>
+
+        </if> 
+           
+        </div>
+        <table class="table table-hover table-bordered">
+            <thead>
+            <tr>
+                <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
+                <th>ID</th>
+                <th>账号</th>
+                <th>{:lang('NICENAME')}</th>
+                <th>真实姓名</th>
+                <th>爱心</th>
+               
+    
+                <if condition="$Request.action eq 'viprechange'">
+                  <th>充值金额</th>
+                  <th>是否vip</th>
+                  <th style="text-align: center;">是否过期</th>
+                  <else/>
+                   <th style="text-align: center;">是否推荐</th>
+                   <th style="text-align: center;">是否置顶</th>
+                </if>
+               
+              
+                <if condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+                  <th>冻结原因</th>
+                <else/>
+                  <th>手机</th>
+                </if>
+                <if condition="$Request.action eq 'custom' || $Request.param.u eq 2 || $Request.param.u eq 4">
+                  <th>网址</th>
+               
+                </if>
+              
+
+                <if condition="$Request.action eq 'userban'  || $Request.param.u eq 3">
+                    <th>冻结时间</th>
+                    <elseif condition=" $Request.action eq 'userlogout' ">
+                  <th>注销时间</th>
+                        <elseif condition=" $Request.action eq 'viprechange' ">
+                            <th>开通时间</th>
+                <else/>
+                <th>{:lang('REGISTRATION_TIME')}</th>
+                </if>
+                <th>登录时间</th>
+                <th>身份证</th>
+                <th>职位</th>
+                <th>学历</th>
+                <th>{:lang('STATUS')}</th>
+                <th>{:lang('ACTIONS')}</th>
+            </tr>
+            </thead>
+            <tbody>
+            <php>
+                $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
+            </php>
+            <foreach name="list" item="vo">
+                <tr>
+                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
+                               value="{$vo.id}" title="ID:{$vo.id}"></td>
+                    <td>{$vo.id}</td>
+                    <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
+                    </td>
+                    <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
+                    <td>{$vo['real_name']?$vo['real_name']:lang('NOT_FILLED')}</td>
+                    <td>{$vo['redheart']}</td>
+                  
+                    <if condition="$Request.action eq 'viprechange'">
+                      <td>{$vo['pay_money']}</td>
+                         <td>
+                           <switch name="vo.vip_auth">
+                             <case value="1">
+                                <span style="color: blue">是</span>
+                             </case>
+                             <case value="0">
+                                <span style="color: red">否</span>
+                              </case>
+                          </switch>
+                         </td>
+                  
+                         <td>
+                           <if condition="$vo.vip_expire gt time()">
+                           
+                                <span style="color: blue" title="{:date('Y-m-d H:i',$vo['vip_expire'])}到期">未过期</span>
+                           <else/>
+                                <span style="color: red">已过期</span>
+                              
+                          </if>
+                         </td>
+
+
+                    <else/>
+
+                     <td style="text-align: center;">
+                      <switch name="vo.is_tuijian">
+                            <case value="1">
+                                <span style="color: blue">是</span>
+                            </case>
+                            <case value="0">
+                                <span style="color: red">否</span>
+                            </case>
+                      </switch>
+
+                    </td>
+                        <td style="text-align: center;">
+                            <switch name="vo.is_top">
+                                <case value="1">
+                                    <span style="color: blue" title="到期时间{$vo.top_expire}">是</span>
+                                </case>
+                                <case value="0">
+                                    <span style="color: red" title="到期时间{$vo.top_expire}">否</span>
+                                </case>
+                            </switch>
+
+                        </td>
+                    </if>
+
+
+                   
+                    <if condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+                       <td><span style="color:red">{$vo.freezing}</span></td>
+                    <else/>
+                        <td>{$vo.mobile}</td>
+                    </if>
+                      <if condition="$Request.action eq 'custom' || $Request.param.u eq 2 || $Request.param.u eq 4">
+                     <td>
+                      <span class="label label-primary copy-btn copy" data-url="{:url('/weixin/member/home?id=','','',true)}{$vo.id}">复制</span>
+                      </td>
+
+                </if>
+                    
+                  <if condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+                       <td>{$vo.updated_at}</td>
+                      <elseif condition=" $Request.action eq 'userlogout' ">
+                          <td>{$vo.updated_at}</td>
+                          <elseif condition=" $Request.action eq 'viprechange' ">
+                              <td>{$vo.updated_at}</td>
+                        <else/> 
+                         <td>{:date('Y-m-d H:i',$vo['create_time'])}</td>
+                    </if>
+                    <td>{:date('Y-m-d H:i',$vo['last_login_time'])}</td>
+                    <td>
+                         <switch name="vo.idcard_check">
+                            <case value="1">
+                               <span style="color:red">未审</span>
+                            </case>
+                            <case value="2">
+                              <span style="color:green">已审</span>
+                            </case>
+                            <case value="3">
+                               <span style="color:#ef9413">驳回</span>
+                            </case>
+                            <case value="">
+                                <span style="color:blue">未填</span>
+                            </case>
+                        </switch>
+                    </td>
+                    <td>
+                        <switch name="vo.position_check">
+                           <case value="0">
+                               <span style="color:blue">未填</span>
+                            </case>
+                            <case value="1">
+                               <span style="color:red">未审</span>
+                            </case>
+                            <case value="2">
+                              <span style="color:green">已审</span>
+                            </case>
+                            <case value="3">
+                               <span style="color:#ef9413">驳回</span>
+                            </case>
+                              <case value="">
+                               <span style="color:blue">未填</span>
+                            </case>
+                        </switch>
+                    </td>
+                    <td>
+                        <switch name="vo.education_check">
+                           <case value="0">
+                               <span style="color:blue">未填</span>
+                            </case>
+                            <case value="1">
+                               <span style="color:red">未审</span>
+                            </case>
+                            <case value="2">
+                              <span style="color:green">已审</span>
+                            </case>
+                            <case value="3">
+                               <span style="color:#ef9413">驳回</span>
+                            </case>
+                              <case value="">
+                               <span style="color:blue">未填</span>
+                            </case>
+                        </switch>
+
+                    </td>
+                  
+                    <td>
+
+                        
+                  <if condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">
+                        <if condition="$vo.idcard eq '' || $vo.idcard eq null">
+                               <span style="color:green">身份已清除</span>
+                                
+                           <else/>
+                               <span style="color:red">身份未清除</span>
+                        </if>
+                      <else/>
+                        <switch name="vo.user_status">
+                              <case value="0">
+                                  <span class="label label-danger">已冻结</span>
+                              </case>
+                              <case value="1">
+                                  <span class="label label-success">{$user_statuses[$vo['user_status']]}</span>
+                              </case>
+                              <case value="2">
+                                  <span class="label label-warning">{$user_statuses[$vo['user_status']]}</span>
+                              </case>
+                          </switch>
+                    </if>
+                      
+                    </td>
+                   
+                    <td>
+
+                      <if condition="$Request.action eq 'userlogout' || $Request.param.u eq 5">
+                    <a class="btn btn-xs btn-primary" href="{:url('adminIndex/edit',array('id'=>$vo['id']))}">编辑</a>
+                   
+                              <a class="btn btn-xs btn-warning js-ajax-dialog-btn" style="background-color: #d00a81;border-color:#d00a81"  href="{:url('adminIndex/touserlogout',array('yes'=>1,'ids'=>$vo['id']))}" data-msg="确认清理该用户身份证信息?">清除身份证信息</a>
+
+                    <else/>
+
+                            <if condition="$Request.action eq 'custom' || $Request.param.u eq 2">
+                          <a class="btn btn-xs btn-primary" href="{:url('adminIndex/edit',array('id'=>$vo['id'],'u'=>2))}">编辑</a>
+                          <else/>
+                           <a class="btn btn-xs btn-primary" href="{:url('adminIndex/edit',array('id'=>$vo['id']))}">编辑</a>
+                        </if>
+
+                          <neq name="vo.id" value="1">
+                              <empty name="vo.user_status">
+                                  <a class="btn btn-xs btn-success js-ajax-dialog-btn"
+                                     href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"
+                                     data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
+                                  <else/>
+                                <!--   <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
+                                     href="{:url('adminIndex/ban',array('id'=>$vo['id']))}"
+                                     data-msg="确认冻结该用户?">冻结</a> -->
+                                      <a class="btn btn-xs btn-warning" onclick="getPaike({$vo['id']})" 
+                                    >冻结</a>
+                              </empty>
+                              <else/>
+                              <a class="btn btn-xs btn-warning disabled">冻结</a>
+
+                          </neq>
+
+                        <if condition="$Request.action neq 'userlogout' || $Request.param.u neq 5">
+
+                            <a class="btn btn-xs btn-warning" style="background-color: #5c0d8e;border-color:#5c0d8e" onclick="checkLogout({$vo['id']});">注销</a>
+<!--                            <a class="btn btn-xs btn-warning js-ajax-dialog-btn" style="background-color: #5c0d8e;border-color:#5c0d8e" onclick="checkLogout()" href="{:url('adminIndex/tozhuxiao',array('yes'=>1,'ids'=>$vo['id']))}" data-msg="确认注销该用户?">注销</a>-->
+                        </if>
+                          <if condition="$Request.action eq 'userban' || $Request.param.u eq 3">
+
+                            <else/>
+                             <a class="btn btn-xs btn-danger" href="{:url('adminIndex/accountadd',array('id'=>$vo['id']))}">爱心充值</a>
+                          </if>
+
+                          <if condition="$Request.action eq 'screen' || $Request.param.u eq 2">
+                             
+                              <a class="btn btn-xs btn-danger" style="background-color: #e807b8;border-color:#e807b8" onclick="getPaike2({$vo['id']})">备注</a>
+
+                          </if>
+
+                      </if>
+                     
+                        
+                         
+                    </td>
+                </tr>
+            </foreach>
+            </tbody>
+        </table>
+        <div class="pagination">{$page}</div>
+    </form>
+</div>
+<style>
+    .auto label {
+        font-weight: normal;
+        vertical-align: middle;
+    }
+    .auto label input {
+        vertical-align: top;
+    }
+</style>
+<script src="__STATIC__/js/admin.js"></script>
+<script src="__STATIC__/js/clipboard.min.js"></script>
+<script src="__STATIC__/js/layer/layer.js"></script>
+<script src="__STATIC__/js/position/position1.js" type="text/javascript"></script>
+<script src="__STATIC__/js/height/height.js" type="text/javascript"></script>
+<script>
+
+    function reloadPage(win) {
+        win.location.reload();
+    }
+
+    /**
+     * 生成二维啊
+     * @returns {boolean}
+     */
+    function makeQrcode() {
+        var url = $("#url").val();
+        if(url == '' || url == null){
+            showMsg('请填写生成参数');
+            return false;
+        }
+
+        // 生成处理
+        $(".qrcode a").html("二维码生成中...");
+        $.post('/user/recommend/makeQrcode', {url: url}, function(res){
+            if(res.code == 'success'){
+                showMsg(res.message);
+                $(".qrcode a").attr('data-href', res.data.qrcode);
+                $(".qrcode a").html('<img src="'+res.data.qrcode+'" width="48" height="48"/>');
+            }else{
+                $(".qrcode a").html("");
+                showMsg(res.message);
+            }
+        },'json');
+    }
+
+    $(function () {
+        var copyText = '';
+        var copyBox = new ClipboardJS('.copy',{
+            text: function (e) {
+                if(copyText=='' || copyText == null){
+                    showMsg('暂无复制内容');
+                    return false;
+                }
+                return copyText;
+            }
+        });
+        copyBox.on("success",function(e){
+            console.log(e);
+            showMsg('复制成功');
+        });
+        copyBox.on("error",function(e){
+            showMsg('复制失败');
+        });
+
+        $(".copy-btn").click(function(){
+            copyText = $(this).attr('data-url');
+        });
+
+        $(".qrcode a").click(function(){
+            var url = $(this).attr('data-href');
+            if(url){
+                imagePreviewDialog(url);
+            }
+        })
+
+        setCookie("refersh_time", 3);
+        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
+            //批量冻结
+            $('#js-batch-delete').click(function (e) {
+                var ids = [];
+                $("input[name='ids[]']").each(function () {
+                    if ($(this).is(':checked')) {
+                        ids.push($(this).val());
+                    }
+                });
+
+                if (ids.length == 0) {
+
+                    return false;
+                }
+
+                ids = ids.join(',');
+                /*art.dialog.open("/user/admin_index/del.html?ids="+ids, {
+                    title: "批量冻结",
+                    width: "300px",
+                    close : function () {
+                        art.dialog.open.origin.location.reload();
+                    }
+                });*/
+            });
+            //end
+        });
+    });
+
+</script>
+<script type="text/javascript" >
+         //获得大职位下拉框对象
+          var province = document.getElementById("position1");
+          //遍历大职位数据,并把里面大职位的数据追加到option选项中
+          for (var i=0; i<positions.length; i++) {
+              var option = document.createElement("option");
+              option.value = positions[i].p_name;
+              option.innerHTML = positions[i].p_name;
+              province.appendChild(option);
+          }
+
+          
+           
+          //  function abc(){   
+          //   alert(document.getElementById('position1').value);
+
+          //   var  proindex=  document.getElementById('position1').selectedIndex;
+          //   var  cityindex=  document.getElementById('position2').selectedIndex;
+          //   alert(document.getElementById('position1').options[proindex].text+document.getElementById('position2').options[cityindex].text);
+          // }
+      </script>
+
+  <script type="text/javascript" >
+         //获得身高下拉框对象
+          var province = document.getElementById("height");
+          //遍历身高数据,并把里面身高的数据追加到option选项中
+          for (var i=0; i<heights.length; i++) {
+              var option = document.createElement("option");
+              option.value = heights[i].p_id;
+              option.innerHTML = heights[i].p_name;
+              province.appendChild(option);
+          }
+
+    </script>
+
+     <script type="text/javascript" >
+         //获得身高下拉框对象
+          var provincet = document.getElementById("heightt");
+          //遍历身高数据,并把里面身高的数据追加到option选项中
+          for (var i=0; i<heights.length; i++) {
+              var option = document.createElement("option");
+              option.value = heights[i].p_id;
+              option.innerHTML = heights[i].p_name;
+              provincet.appendChild(option);
+          }
+
+            provincet.onchange = function() { 
+                 var heightval=this.value;
+              
+                 if($('#height').val()!='none'){
+                     if($('#height').val()>this.value){
+                        alert('开始升高不能大于结束身高!');
+                     }
+   
+                 }
+                 
+            }
+
+    </script>
+
+<script>
+    function reloadPage(win) {
+        win.location.reload();
+    }
+
+    $(function () {
+        setCookie("refersh_time", 3);
+        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
+            //批量冻结
+            $('#js-batch-delete').click(function (e) {
+                var ids = [];
+                $("input[name='ids[]']").each(function () {
+                    if ($(this).is(':checked')) {
+                        ids.push($(this).val());
+                    }
+                });
+
+                if (ids.length == 0) {
+
+                    return false;
+                }
+
+                ids = ids.join(',');
+                /*art.dialog.open("/user/admin_index/del.html?ids="+ids, {
+                    title: "批量冻结",
+                    width: "300px",
+                    close : function () {
+                        art.dialog.open.origin.location.reload();
+                    }
+                });*/
+            });
+            //end
+        });
+    });
+
+</script>
+<script>
+    function doDelete() {
+        // Wind.use('artDialog', function () {
+            var ids = [];
+            $(".js-check:checked").each(function () {
+                var id = $(this).val();
+                if (id > 0) {
+                    ids.push(id);
+                }
+            });
+            if (ids.length <= 0) {
+                showMsg('请先选择操作项');
+                return false;
+            }
+            if(confirm('确定批量删除选择项?不可恢复')){
+                $.post('/user/admin_index/del',{id:ids},function(res){
+                    if(res.code == 1){
+                        showMsg(res.msg);
+                        setTimeout(function () {
+                            location.reload();
+                        }, 800)
+                    }else{
+                        showMsg(res.msg);
+                    }
+                },"json")
+            }
+
+
+        // });
+    }
+
+    function getPaike(id){ 
+        var addUrl = "{:url('AdminIndex/ban')}?id="+id;
+        layer.open({
+            type: 2, //1:页面层,2:iframe层,3:加载层,4:tips层。
+            title: '条件筛选',
+            shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
+            shade: 0.8, //遮罩
+            area: ['480px', '360px'],
+            content: addUrl,
+            end: function () { //最后执行reload
+                   location.reload();
+                }
+            });
+
+       }
+
+    function checkLogout(id){
+        var addUrl = "{:url('AdminIndex/logout')}?id="+id;
+        layer.open({
+            type: 2, //1:页面层,2:iframe层,3:加载层,4:tips层。
+            title: '注销确认',
+            shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
+            shade: 0.8, //遮罩
+            area: ['360px', '280px'],
+            content: addUrl,
+            end: function () { //最后执行reload
+                location.reload();
+            }
+        });
+
+        return false;
+    }
+
+    /**
+     * 批量移动
+     */
+    function doMove(){
+        var ids = [];
+        $(".js-check:checked").each(function () {
+            var id = $(this).val();
+            if (id > 0) {
+                ids.push(id);
+            }
+        });
+
+        if (ids.length <= 0) {
+            layer.msg('请选择操作的用户')
+            return false;
+        }
+
+        if (confirm('确定批量移动选择的用户到售前公海?请谨慎操作')) {
+            $.post('/admin/pools/moveUser', {ids: ids, type: 1}, function (res) {
+                if (res.code == 1) {
+                    layer.msg(res.msg)
+                    setTimeout(function () {
+                        location.reload();
+                    }, 800)
+                } else {
+                    layer.msg(res.msg)
+                }
+            }, "json")
+        }
+    }
+
+
+    $("#showcho").click(function(){
+          $("#showchoice").show();
+        });     
+        $("#nonecho").click(function(){
+          $("#showchoice").hide();
+        });     
+
+</script>
+<script >
+
+    function getPaike2(id){
+          openIframeLayer("{:url('AdminIndex/showbeizhu')}?id=" + id , "", {
+              area: ['600px', '300px'],
+              // btn: ['确定', '取消'],
+          })
+      }
+  </script>
+</body>
+</html>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3 - 2
public/themes/default/weixin/public/assets/js/home.js


+ 1 - 1
vendor/thinkcmf/cmf-app/src/user/controller/AdminIndexController.php

@@ -88,7 +88,6 @@ class AdminIndexController extends AdminBaseController
 
         // 修改 end
 
-        //var_dump($data);die;
         $params = input();
         $list = Db::name('user')->field('u.id,u.user_login,u.user_nickname,u.avatar_confirm_status,u.real_name,u.is_top,u.top_expire,u.redheart,u.is_tuijian,u.create_time,u.is_heart,u.user_status,u.mobile,u.freezing,u.updated_at,last_login_time,up.idcard,
             up.idcard_check,up.position_check,up.education_check')
@@ -96,6 +95,7 @@ class AdminIndexController extends AdminBaseController
             ->join('user_profile up', 'u.id=up.userid', 'left')
             ->where(function (Query $query) use ($data, $params) {
                 $query->where('u.user_type', 2);
+                $query->where('u.is_outline', 0);
                 $query->where('u.openid', 'not in', '');
 
                 //代表是否付费定制

+ 385 - 0
vendor/thinkcmf/cmf-app/src/user/controller/OutlineController.php

@@ -0,0 +1,385 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: Powerless < wzxaini9@gmail.com>
+// +----------------------------------------------------------------------
+
+namespace app\user\controller;
+
+use app\user\model\PoolModel;
+use app\weixin\service\PRedis;
+use function AlibabaCloud\Client\value;
+use app\user\validate\UserProfileValidate;
+use app\admin\validate\UserValidate;
+use cmf\controller\AdminBaseController;
+use think\Db;
+use think\db\Query;
+use PHPExcel;
+use app\admin\model\AccountLogModel;
+use app\admin\model\UserModel;
+use app\weixin\service\Member;
+use app\weixin\model\Wechat;
+use app\weixin\model\Member as MemberModel;
+
+/**
+ * Class OutlineController
+ * @package app\user\controller
+ *
+ * @adminMenuRoot(
+ *     'name'   =>'用户管理',
+ *     'action' =>'default',
+ *     'parent' =>'',
+ *     'display'=> true,
+ *     'order'  => 10,
+ *     'icon'   =>'group',
+ *     'remark' =>'用户管理'
+ * )
+ *
+ * @adminMenuRoot(
+ *     'name'   =>'用户组',
+ *     'action' =>'default1',
+ *     'parent' =>'user/AdminIndex/default',
+ *     'display'=> true,
+ *     'order'  => 10000,
+ *     'icon'   =>'',
+ *     'remark' =>'用户组'
+ * )
+ */
+class OutlineController extends AdminBaseController
+{
+
+    /**
+     * 后台本站线下用户列表
+     * @adminMenu(
+     *     'name'   => '本站用户',
+     *     'parent' => 'default1',
+     *     'display'=> true,
+     *     'hasView'=> true,
+     *     'order'  => 10000,
+     *     'icon'   => '',
+     *     'remark' => '本站用户',
+     *     'param'  => ''
+     * )
+     */
+    public function index()
+    {
+        $data = $this->request->param();
+        session('search', [
+            'uid' => isset($data['uid']) ? intval($data['uid']) : 0,
+            'keyword' => isset($data['keyword']) ? trim($data['keyword']) : '',
+        ]);
+        // 添加返回历史修改 by  wesmiler 2020-02-16
+        $history = isset($data['history']) ? intval($data['history']) : 0;
+        if ($history) {
+            $data = session('user_search');
+        } else {
+            session('user_search', $data);
+        }
+
+        $params = input();
+        $list = Db::name('user')->field('u.id,u.user_login,u.user_nickname,u.avatar_confirm_status,u.real_name,u.is_top,u.top_expire,u.redheart,u.is_tuijian,u.create_time,u.is_heart,u.user_status,u.mobile,u.freezing,u.updated_at,last_login_time,up.idcard,
+            up.idcard_check,up.position_check,up.education_check')
+            ->alias('u')
+            ->join('user_profile up', 'u.id=up.userid', 'left')
+            ->where(function (Query $query) use ($data, $params) {
+                $query->where('u.user_type', 2);
+                $query->where('u.is_outline', 1);
+                $query->where('u.openid', 'not in', '');
+
+                //代表是否付费定制
+                ($this->request->action() == 'custom' || $this->request->param('u') == 2) ? $query->where('u.is_vip', 1) : $query->where('u.is_vip', 0);
+
+                //代表是否冻结
+                if ($this->request->action() != 'userlogout' && $this->request->param('u') != 5) {
+                    ($this->request->action() == 'userban' || $this->request->param('u') == 3) ? $query->where('u.user_status', 0) : $query->where('u.user_status', 1);
+                } else {
+
+                    //代表是否筛选
+                    ($this->request->action() == 'screen' || $this->request->param('u') == 4) ? $query->where('u.is_screen', 1) : $query->where('u.is_screen', 0);
+                }
+                //代表是否注销
+                if ($this->request->action() != 'userban' && $this->request->param('u') != 3) {
+                    ($this->request->action() == 'userlogout' || $this->request->param('u') == 5) ? $query->where('u.user_status', -1) : $query->where('u.user_status', 1);
+                }
+
+                
+                if (!empty($data['uid'])) {
+                    $query->where('u.id', intval($data['uid']));
+                }
+
+                if (!empty($data['keyword'])) {
+                    $keyword = $data['keyword'];
+                    $query->where('u.user_nickname|u.real_name|u.mobile', 'like', "%$keyword%");
+                }
+                //年龄区间查询
+                if ((!empty($data['age1']) && $data['age1'] != 'none') && (!empty($data['age2']) && $data['age2'] != 'none')) {
+
+                    $query->where('u.birthday', ['>', strtotime($data['age1'])], ['<', strtotime($data['age2'])], 'and');
+                    $query->whereNotNull('u.birthday');
+                }
+
+                // //只有第一个年龄的情况下
+                if ((!empty($data['age1']) && $data['age1'] != 'none') && (empty($data['age2']) || $data['age2'] == 'none')) {
+                    $birthday = $data['age1'];
+                    $query->whereRaw("YEAR(from_unixtime(u.`birthday`))=$birthday and u.birthday is not null ");
+                }
+
+                // //只有第二个年龄的情况下
+                if ((empty($data['age1']) || $data['age1'] == 'none') && (!empty($data['age2']) && $data['age2'] != 'none')) {
+                    $birthday = $data['age2'];
+                    $query->whereRaw("YEAR(from_unixtime(u.`birthday`))=$birthday and u.birthday is not null ");
+                }
+
+                //身高区间查询
+
+                if ((!empty(input('height')) && input('height') != 'none') && (!empty(input('heightt')) && input('heightt') != 'none')) {
+
+                    $query->where('up.height', ['>', input('height')], ['<', input('heightt')], 'and');
+                }
+
+                //身高第一个查找
+                if ((!empty(input('height')) && input('height') != 'none') && (empty(input('heightt')) || input('heightt') == 'none')) {
+
+                    $query->where('up.height', input('height'));
+                }
+
+                //身高第二个查找
+                if ((empty(input('height')) || input('height') == 'none') && (!empty(input('heightt')) && input('heightt') != 'none')) {
+
+                    $query->where('up.height', input('heightt'));
+                }
+
+
+                //学历
+                $education = input('education');
+                $education = !empty($education) ? $education : [];
+                if ($education) {
+                    $query->whereIn('up.education', $education);
+                }
+                //职位
+                if ((!empty(input('occupation')) && input('occupation') != 'none')) {
+
+                    $query->where('up.occupation', input('occupation'));
+                }
+                //收入
+                if ((!empty(input('salary')) && input('salary') != 'none')) {
+
+                    $query->where('up.salary', input('salary'));
+                }
+
+                //资产
+                if ((!empty(input('property')) && input('property') != 'none')) {
+
+                    $query->where('up.property', input('property'));
+                }
+
+                //家乡
+                $home = isset($params['home']) ? $params['home'] : 0;
+                $homeCity = isset($params['home_city']) ? $params['home_city'] : 0;
+                if ($home == 1) {
+                    $query->where('up.home_province', 'like', '%广西%');
+                } else if ($home == 2) {
+                    $query->where('up.home_province', 'notlike', '%广西%');
+                } else if ($homeCity) {
+                    $query->where('up.home_province|up.home_city', 'like', '%' . input('home_city') . '%', 'or');
+                }
+                //居住地(市)
+
+                if ((!empty(input('city')) && input('city') != 'none')) {
+
+                    $query->where('up.city', 'like', '%' . input('city') . '%');
+                }
+                //婚姻状况
+                if ((!empty(input('married')) && input('married') != 'none')) {
+
+                    $query->where('up.married', input('married'));
+                }
+
+                //性别
+                if ((!empty(input('sex')) && input('sex') != 'none')) {
+
+                    $query->where('u.sex', input('sex'));
+                }
+
+                //实名
+                $idcard = isset($params['idcard']) ? $params['idcard'] : 0;
+                if ($idcard == 1) {
+                    $query->whereIn('up.idcard_check', 2);
+                } else if ($idcard == 2) {
+                    $query->whereNotIn('up.idcard_check', 2);
+                }
+            })
+
+            //待审核
+            ->order("u.create_time DESC")
+            ->paginate(10, false, ['query' => request()->param()]);
+
+        // 获取分页显示
+        $page = $list->render();
+        $datas = $list ? $list->toArray() : [];
+        if ($datas) {
+            foreach ($datas['data'] as $k => $item) {
+                $datas['data'][$k]['is_top'] = 0;
+                $isTop = isset($item['is_top']) ? $item['is_top'] : 0;
+                $topExpire = isset($item['top_expire']) ? $item['top_expire'] : '';
+                if ($isTop && $topExpire > date('Y-m-d H:i:s')) {
+                    $datas['data'][$k]['is_top'] = 1;
+                }
+            }
+            unset($item);
+        }
+
+        $this->assign('params', $params);
+        $this->assign('list', $datas['data']);
+        $this->assign('page', $page);
+
+        // 渲染模板输出
+        return $this->fetch();
+    }
+
+    /**
+     * 编辑
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function edit()
+    {
+        // 
+        // $id    = $this->request->param('id', 0, 'intval');
+        // $user = DB::name('user')->where("id", $id)->find();
+        $data = $this->request->param();
+        // session('search',[
+        //         'uid' => isset($data['uid'])? intval($data['uid']) : 0,
+        //         'keyword' => isset($data['keyword'])? trim($data['keyword']) : '',
+        //     ]);
+        //var_dump($data);die;
+        $user = Db::name('user')->field('u.id,u.openid,u.avatar,u.avatar_confirm_status,u.weixin_num,u.sex,u.balance,u.birthday,u.score,u.user_login,u.user_nickname,u.real_name,u.redheart,u.is_tuijian,u.is_top,u.top_expire,u.create_time,u.is_heart,u.user_status,u.mobile,u.agent_type,u.parent_id,
+            up.idcard_check,up.wechat_code,up.salary,up.position_check,up.education_check,up.height,up.weight,up.education,up.occupation,up.married,up.province,up.city,up.district,up.home_province,up.home_city,up.home_district')
+            ->alias('u')
+            ->join('user_profile up', 'u.id=up.userid', 'left')
+            ->where('u.id', input('id'))
+            ->where(function (Query $query) {
+                $query->where('u.user_type', 2);
+
+                ($this->request->action() == 'custom' || $this->request->param('u') == 2) ? $query->where('u.is_vip', 1) : $query->where('u.is_vip', 0);
+
+            })
+            ->find();
+        // var_dump($user);die;
+
+        $this->assign($user);
+        return $this->fetch();
+    }
+
+    /**
+     * 编辑处理
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function editPost()
+    {
+        // $page=$this->request->param;
+        //  echo $page['page'];die();
+        if ($this->request->isPost()) {
+
+
+            if (empty($_POST['user_pass'])) {
+                unset($_POST['user_pass']);
+            } else {
+                $_POST['user_pass'] = cmf_password($_POST['user_pass']);
+            }
+
+            $validate = new UserValidate();
+            $result = $validate->scene('info')->check($this->request->param());
+
+            if ($result !== true) {
+                // 验证失败 输出错误信息
+                $this->error($validate->getError());
+            } else {
+                // $_POST['birthday']=strtotime($_POST['birthday']);
+                //分开保存。用户的
+                $user['mobile'] = $_POST['mobile'];
+                $user['user_nickname'] = $_POST['user_nickname'];
+                $user['real_name'] = $_POST['real_name'];
+                if ($_POST['sex'] == '男') {
+                    $user['sex'] = 1;
+                } else {
+                    $user['sex'] = 2;
+                }
+
+                $user['is_top'] = intval($_POST['is_top']);
+                $user['top_expire'] = trim($_POST['top_expire']);
+                $user['redheart'] = $_POST['redheart'];
+                // $user['birthday']=strtotime($_POST['birthday']);
+                $user['user_status'] = $_POST['user_status'];
+                //通过用户来查询是否存在父级了
+                // $parent_id=Db::name('user')->field('parent_id')->find($_POST['id']);
+                // if($parent_id){
+                //   $this->error('已存在该上级!');
+                // }
+                //通过输入的parent_id判断是否存在这个人。
+                $parentId = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;
+                if ($parentId) {
+                    $parent_result = Db::name('user')->find($parentId);
+                    if (!$parent_result) {
+                        $this->error('不存在该上级用户!');
+                    }
+                    $user['parent_id'] = $parentId;
+                }
+
+
+                //用户详情的
+                $userinfo['wechat_code'] = $_POST['weixin_num'];
+                $userinfo['height'] = $_POST['height'];
+                $userinfo['weight'] = $_POST['weight'];
+                $userinfo['salary'] = $_POST['salary'];
+                $userinfo['education'] = $_POST['education'];
+                $userinfo['occupation'] = $_POST['position1'];
+                $userinfo['province'] = $_POST['province'];
+                $userinfo['city'] = $_POST['city'];
+                $userinfo['district'] = $_POST['district'];
+                $userinfo['home_province'] = $_POST['home_province'];
+                $userinfo['home_city'] = $_POST['home_city'];
+                $userinfo['home_district'] = $_POST['home_district'];
+                $userinfo['married'] = $_POST['married'];
+
+                Db::startTrans();
+                $result = DB::name('user')->where('id', $_POST['id'])->update($user);
+
+                if ($result !== false) {
+
+                    if (Db::name('user_profile')->where('userid', $_POST['id'])->value('id')) {
+                        $userpro_result = Db::name('user_profile')->where('userid', $_POST['id'])->update($userinfo);
+                    } else {
+                        $userinfo['userid'] = $_POST['id'];
+                        $userpro_result = Db::name('user_profile')->insertGetId($userinfo);
+                    }
+
+
+                    if ($userpro_result !== false) {
+
+                        Db::commit();
+                        $this->success("保存成功!", '/user/admin_index/index');
+                    } else {
+
+                        Db::rollback();
+                        $this->error("保存失败!");
+                    }
+
+                } else {
+                    Db::rollback();
+                    $this->error("保存失败!");
+                }
+            }
+
+
+        }
+    }
+}