소스 검색

wes 多宝福袋 更新合并导致的问题

wesmiler 3 년 전
부모
커밋
2970e49a40
3개의 변경된 파일40개의 추가작업 그리고 180개의 파일을 삭제
  1. 0 177
      app/admin/controller/user/User.php
  2. 11 1
      app/admin/logic/ScoreLogLogic.php
  3. 29 2
      app/admin/view/system/config/site.html

+ 0 - 177
app/admin/controller/user/User.php

@@ -99,43 +99,6 @@ class User extends AdminController
         return $this->fetch();
     }
 
-
-    /**
-     * 添加用户(功能不存在)
-     * @return mixed
-     */
-    /*public function add()
-    {
-        if ($this->request->isAjax()) {
-            $post   = $this->request->post();
-            $mobile = $this->model->where('mobile', $post['mobile'])->value('id');
-            $mobile && $this->error('该手机号码已被注册');
-            $invite = $this->model->where('code|px_code', $post['code'])->value('id');
-            !$invite && $this->error('邀请人不存在');
-            $this->model->startTrans();
-            try {
-                $insert['mobile']    = $post['mobile'];
-                $insert['reg_ip']    = $this->request->ip();
-                $insert['avatar']    = 'http://images.yxj.hongyun63.com/user/default_avatar.jpg';
-                $insert['code']      = create_invite_code();
-                $insert['px_code']   = create_invite_code();
-                $insert['user_type'] = 2;
-                $rz_money            = 1.5 + rand(0, 30) / 100;
-                $this->model->save($insert);
-                $uid       = $this->model->id;
-                $user_data = new UserData();
-                $user_data->save(['uid' => $uid, 'rz_money' => $rz_money]); // 保存用户关联信息
-                $this->bindRelation($post['code'], $uid); // 绑定关系
-                $this->model->commit();
-            } catch (\Exception $e) {
-                $this->model->rollback();
-                $this->error('添加用户失败');
-            }
-            $this->success('添加成功');
-        }
-        return $this->fetch();
-    }*/
-
     /**
      * 邀请页面
      * @return mixed
@@ -190,38 +153,6 @@ class User extends AdminController
         return $this->fetch();
     }
 
-    /**
-     * 增加余额(功能已屏蔽)
-     * @return mixed
-     */
-    /*public function editmoney()
-    {
-        if ($this->request->isPost()) {
-
-            $post  = $this->request->post();
-            $user  = $this->model->findOrEmpty(['id' => $post['uid']]);
-            $money = $post['money'];
-            $type  = $post['type'];
-            empty($user) && $this->error('用户不存在');
-
-            $this->model->startTrans();
-            try {
-                if ($type == 'more') {
-                    edit_user_money(7, $post['uid'], $money);
-                } else {
-                    edit_user_money(8, $post['uid'], $money);
-                }
-
-                $this->model->commit();
-            } catch (\Exception $e) {
-                $this->model->rollback();
-                $this->error('失败' . $e->getMessage());
-            }
-            $this->success('成功');
-        }
-
-        return $this->fetch();
-    }*/
 
     /**
      * 修改手机号码
@@ -328,33 +259,6 @@ class User extends AdminController
         return $this->fetch();
     }
 
-    /**
-     * 末尾奖励(功能已注释)
-     * @return mixed
-     */
-    /*public function moweiscore()
-    {
-        if ($this->request->isPost()) {
-            $post = $this->request->post();
-            $user = $this->model->findOrEmpty(['id' => $post['uid']]);
-
-            $money = $post['money'];
-            empty($user) && $this->error('用户不存在');
-
-            $this->model->startTrans();
-            try {
-                edit_user_score(8, $post['uid'], $money);
-                $this->model->commit();
-            } catch (\Exception $e) {
-                $this->model->rollback();
-                $this->error('失败' . $e->getMessage());
-            }
-            $this->success('成功');
-        }
-
-        return $this->fetch();
-    }*/
-
 
     /**
      * 余额明细
@@ -409,50 +313,6 @@ class User extends AdminController
     }
 
     /**
-     * 元宝明细(功能已失效)
-     * @param CoinLog $model
-     * @return mixed|\think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     */
-    /*public function coinLog(CoinLog $model)
-    {
-        if ($this->request->isAjax()) {
-            if (input('selectFields')) {
-                return $this->selectList();
-            }
-            list($page, $limit, $where) = $this->buildTableParames();
-            $where[]   = ['uid', '=', $this->request->param('id', '')];
-            $count     = $model
-                ->where($where)
-                ->count();
-            $type_conf = config('type.coin');
-            $list      = $model
-                ->where($where)
-                ->withAttr('type', function ($value, $data) use ($type_conf) {
-                    return $type_conf[$value];
-                })
-                ->withAttr('coin', function ($value, $data) {
-                    if ($data['state'] == 2)
-                        $value = '-' . $value;
-                    return $value;
-                })
-                ->page($page, $limit)
-                ->order($this->sort)
-                ->select();
-            $data      = [
-                'code'  => 0,
-                'msg'   => '',
-                'count' => $count,
-                'data'  => $list,
-            ];
-            return json($data);
-        }
-        return $this->fetch();
-    }*/
-
-    /**
      * 积分明细
      * @return mixed|\think\response\Json
      */
@@ -544,43 +404,6 @@ class User extends AdminController
     }
 
 
-    /**
-     * 团队充值(已失效)
-     * @return mixed
-     */
-    /*public function teamincome(Request $request)
-    {
-        if ($this->request->isAjax()) {
-
-//            if (($pid = $this->request->param('pid')) !== false && $pid)
-//                $where[] = ['pid', '=', $this->request->param('pid', '')];
-            $id = $this->request->param('id');
-//            $path = Db::name('user')->where('id', $id)->value('path');
-            $where   = array();
-            $where[] = ['team_id', '=', $id];
-            $where[] = ['type', '=', 5];
-            $count   = Db::name('userteam_log')
-//                ->withJoin('user', 'INNER')
-                ->where($where)
-                ->count();
-            $list    = Db::name('userteam_log')
-//                ->withJoin('user', 'INNER')
-                ->where($where)
-                ->order($this->sort)
-                ->select();
-
-
-            $data = [
-                'code'  => 0,
-                'msg'   => '成功',
-                'count' => $count,
-                'data'  => $list,
-            ];
-            return json($data);
-        }
-        return $this->fetch();
-    }*/
-
     /*
     * 修改积分
     * @return mixed

+ 11 - 1
app/admin/logic/ScoreLogLogic.php

@@ -48,7 +48,17 @@ class ScoreLogLogic
         return self::$typeMap;
     }
 
-    public static function scoreLog($page, $limit, $where, $sort)
+    /**
+     * 积分记录
+     * @param mixed $page
+     * @param mixed $limit
+     * @param mixed $where
+     * @param array $sort
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public static function scoreLog(mixed $page, mixed $limit, mixed $where, array $sort)
     {
         $model     = new ScoreLogModel();

+ 29 - 2
app/admin/view/system/config/site.html

@@ -1,8 +1,35 @@
 <form id="app-form" class="layui-form layuimini-form">
+    <div class="layui-form-item">
+        <label class="layui-form-label">站点运行</label>
+        <div class="layui-input-block">
+            {php} $status = sysconfig('site','site_web_is_update') {/php}
+            <input type="radio" name="site_web_is_update" class="layui-input"
+                   lay-verify="required" value="0"
+                   {if $status!=1}checked=""{/if} title="运行中">
+            <input type="radio" name="site_web_is_update" class="layui-input"
+                   lay-verify="required" value="1" {if $status==1}checked=""{/if} title="维护中">
+            <div><tip>站点是否设置维护中。</tip></div>
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <label class="layui-form-label">可访问IP</label>
+        <div class="layui-input-block">
+            <input type="text" name="site_access_ips" class="layui-input" placeholder="请输入IP,多个小写竖线分隔" value="{:sysconfig('site','site_access_ips')}">
+            <tip>设置维护升级时可访问IP。</tip>
+        </div>
+    </div>
 
     <div class="layui-form-item">
-        <label class="layui-form-label">站点名称</label>
+        <label class="layui-form-label">维护提示信息</label>
         <div class="layui-input-block">
+            <input type="text" name="site_update_tips" class="layui-input" placeholder="请输入提示信息" value="{:sysconfig('site','site_update_tips')}">
+            <tip>站点维护中提示信息。</tip>
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">站点名称</label>
+        <div class="layui-input-block">app/admin/view/system/config/index.html
             <input type="text" name="site_name" class="layui-input" lay-verify="required" placeholder="请输入站点名称" value="{:sysconfig('site','site_name')}">
             <tip>填写站点名称。</tip>
         </div>
@@ -30,7 +57,7 @@
     <div class="layui-form-item">
         <label class="layui-form-label">备案信息</label>
         <div class="layui-input-block">
-            <input type="text" name="site_beian" class="layui-input" lay-verify="required" placeholder="请输入备案信息" value="{:sysconfig('site','site_beian')}">
+            <input type="text" name="site_beian" class="layui-input" placeholder="请输入备案信息" value="{:sysconfig('site','site_beian')}">
             <tip>填写备案信息。</tip>
         </div>
     </div>