Kaynağa Gözat

后台统计,用户绑定上级,钱包日志修改

lizhen_gitee 2 ay önce
ebeveyn
işleme
ff4e35768d

+ 2 - 2
application/admin/controller/Dashboard.php

@@ -56,8 +56,8 @@ class Dashboard extends Backend
         $this->view->assign([
             'totaluser'         => User::count(),
             'totaladdon'        => $totaladdon,
-            'totaldoctor'        => Db::name('doctor')->count(),
-            'totalcategory'     => \app\common\model\Category::count(),
+
+        
             'todayusersignup'   => User::whereTime('jointime', 'today')->count(),
             'todayuserlogin'    => User::whereTime('logintime', 'today')->count(),
             'sevendau'          => User::whereTime('jointime|logintime|prevtime', '-7 days')->count(),

+ 1 - 9
application/admin/view/dashboard/index.html

@@ -199,15 +199,7 @@
                             </div>
                         </div>
                     </div>
-                    <div class="col-sm-3 col-xs-6">
-                        <div class="sm-st clearfix">
-                            <span class="sm-st-icon st-green"><i class="fa fa-user"></i></span>
-                            <div class="sm-st-info">
-                                <span>{$totaldoctor}</span>
-                                总医生数
-                            </div>
-                        </div>
-                    </div>
+
                 </div>
 
                 <div class="row">

+ 17 - 0
application/api/controller/User.php

@@ -158,6 +158,23 @@ class User extends Api
         $this->success();
     }
 
+    //绑定上级
+    public function bind_intro(){
+        $introcode = input('introcode','','trim');
+
+        if(!empty($introcode) && $this->auth->isLogin() && empty($this->auth->intro_uid)){
+            $intro_user = Db::name('user')->where('introcode',$introcode)->field('id,intro_uid')->find();
+
+            if(!empty($intro_user) && $intro_user['id'] != $this->auth->id && $intro_user['intro_uid'] != $this->auth->id){
+                Db::name('user')->where('id',$this->auth->id)->update(['intro_uid'=>$intro_user['id']]);
+            }
+        }
+
+        $this->success(1);
+    }
+
+
+
     //假注销
     public function cancleUser(){
         /*$captcha = input('captcha','');

+ 5 - 5
application/api/controller/Userwallet.php

@@ -43,7 +43,7 @@ class Userwallet extends Api
         $this->success('success',$list);
     }
 
-    //我的余额日志
+    //我的核销余额日志
     public function my_hexiaomoney_log(){
         $type = input('type',0);
 
@@ -58,7 +58,7 @@ class Userwallet extends Api
             $map['change_value'] = ['lt',0];
         }
 
-        $list = Db::name('user_money_log')
+        $list = Db::name('user_hexiaomoney_log')
             ->field('id,log_type,before,change_value,remain,remark,createtime')
             ->where($map)->order('id desc')->autopage()->select();
 //        $list = $this->list_appen_logtext($list);
@@ -66,8 +66,8 @@ class Userwallet extends Api
         $this->success('success',$list);
     }
 
-    //我的余额日志
-    public function my_fenxiaomoney_log(){
+    //我的分销余额日志
+    public function my_intromoney_log(){
         $type = input('type',0);
 
         $map = [
@@ -81,7 +81,7 @@ class Userwallet extends Api
             $map['change_value'] = ['lt',0];
         }
 
-        $list = Db::name('user_money_log')
+        $list = Db::name('user_intromoney_log')
             ->field('id,log_type,before,change_value,remain,remark,createtime')
             ->where($map)->order('id desc')->autopage()->select();
 //        $list = $this->list_appen_logtext($list);

+ 3 - 3
application/extra/wallet.php

@@ -13,10 +13,10 @@ return [
         31 => '商城购物',//money -
 //        32 => '商城退款',//money +
 ///////////////////////
-        100 => '',
+        101 => '',  //intromoney
 
-        121 => '钱包余额提现',//money -
-        122 => '提现拒绝返回',//money +
+        121 => '钱包余额提现',//intromoney -
+        122 => '提现拒绝返回',//intromoney +
 ///////////////////////
         201 => '核销订单',//hexiaomoney +