Browse Source

删除无用代码

lizhen_gitee 2 months ago
parent
commit
841925cb56

+ 0 - 98
application/admin/controller/agent/Admin.php

@@ -60,108 +60,10 @@ class Admin extends Backend
         }
 
         $this->view->assign('groupdata', $groupdata);
-        //公会
-        $gh = Db::name('gonghui')->order('id asc')->column('id,name');
-        $this->assign('gh',$gh);
-        //公会
         $this->assignconfig("admin", ['id' => $this->auth->id]);
     }
 
-    /**
-     * 查看
-     */
-    public function index()
-    {
-        //设置过滤方法
-        $this->request->filter(['strip_tags', 'trim']);
-        if ($this->request->isAjax()) {
-            //如果发送的来源是Selectpage,则转发到Selectpage
-            if ($this->request->request('keyField')) {
-                return $this->selectpage();
-            }
-//            $childrenGroupIds = $this->childrenGroupIds;
-//            $groupName = AuthGroup::where('id', 'in', $childrenGroupIds)
-//                ->column('id,name');
-//            $authGroupList = AuthGroupAccess::where('group_id', 'in', $childrenGroupIds)
-//                ->field('uid,group_id')
-//                ->select();
-
-//            $adminGroupName = [];
-//            foreach ($authGroupList as $k => $v) {
-//                if (isset($groupName[$v['group_id']])) {
-//                    $adminGroupName[$v['uid']][$v['group_id']] = $groupName[$v['group_id']];
-//                }
-//            }
-//            $groups = $this->auth->getGroups();
-//            foreach ($groups as $m => $n) {
-//                $adminGroupName[$this->auth->id][$n['id']] = $n['name'];
-//            }
-
-
-
-            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
-            $map['user_id'] = ['gt', 0];
-            if ($this->auth->id != 1 && $this->auth->id != 11) {
-                $map['id'] = $this->auth->id;
-            }
-
-            $list = $this->model
-//                ->where($where)
-                ->where($map)
-//                ->where('id', 'in', $this->childrenAdminIds)
-                ->field(['password', 'salt', 'token'], true)
-                ->order($sort, $order)
-                ->paginate($limit);
 
-            //获取时间
-            $searchwhere = $this->request->get("filter", '');
-            $searchwhere = (array)json_decode($searchwhere, true);
-            if (isset($searchwhere['time'])) {
-                $starttime = strtotime(mb_substr($searchwhere['time'], 0, 19));
-                $endtime = strtotime(mb_substr($searchwhere['time'], 23, 19));
-            } else { //若没有 则显示本周
-                $starttime = strtotime(date('Y-m-d')) - ((date('w')==0?7:date('w'))-1)*86400;
-                $endtime = $starttime + 86400 * 7 - 1;
-            }
-
-
-            $money_map['log_type'] = ['in', [21, 22, 23, 54, 60, 82]];
-            $money_map['createtime'] = ['between', [$starttime, $endtime]];
-
-            $mt_user_money_log = Db::name('user_money_log');
-            $mt_user = Db::name('user');
-            $mt_extend_reward = Db::name('extend_reward');
-            foreach ($list as $k => &$v) {
-//                $groups = isset($adminGroupName[$v['id']]) ? $adminGroupName[$v['id']] : [];
-//                $v['groups'] = implode(',', array_keys($groups));
-//                $v['groups_text'] = implode(',', array_values($groups));
-
-                $user_ids = $mt_user->where(['intro_uid' => $v['user_id']])->column('id');
-                $user_ids = $user_ids ? : [];
-                $money_map['user_id'] = ['in', $user_ids];
-                //总收益
-                $week_sum_money = $mt_user_money_log->where($money_map)->sum('change_value');
-                $week_sum_money = $week_sum_money > 0 ? $week_sum_money : 0;
-                $v['week_sum_money'] = $week_sum_money;
-                //查询等级
-                $extend_reward_info = $mt_extend_reward->where(['total_flow' => ['elt', $week_sum_money]])->order('id desc')->find();
-                if ($extend_reward_info) {
-                    $v['extend_name'] = $extend_reward_info['name'];
-                    $v['extra_reward'] = $extend_reward_info['extra_reward'];
-                    $v['extra_moeny'] = number_format($week_sum_money * $extend_reward_info['extra_reward'] / 100, 2, '.', '');
-                } else {
-                    $v['extend_name'] = '';
-                    $v['extra_reward'] = '';
-                    $v['extra_moeny'] = '';
-                }
-            }
-            $result = array("total" => $list->total(), "rows" => $list->items());
-
-            return json($result);
-        }
-        return $this->view->fetch();
-    }
 
     /**
      * 批量更新

+ 1 - 2
application/admin/model/agent/Extendreward.php

@@ -12,8 +12,7 @@ class Extendreward extends Model
 
     
 
-    // 表名
-    protected $name = 'extend_reward';
+
     
     // 自动写入时间戳字段
     protected $autoWriteTimestamp = 'int';

+ 0 - 111
application/index/controller/Plantask.php

@@ -325,115 +325,4 @@ class Plantask extends Controller
     ////////////////////////////////////////////////////////
 
 
-
-
-
-    //发放代理奖励。没用到
-    public function issuingreward() {
-        set_time_limit(0);
-
-        //本周开始时间
-        $week_start_time = strtotime(date('Y-m-d')) - ((date('w')==0?7:date('w'))-1)*86400;
-        $where['user_id'] = ['gt', 0];
-        $where['issuingtime'] = ['elt', $week_start_time];
-
-        $mt_admin = Db::name('admin');
-        $list = $mt_admin->field('id, user_id, issuingtime')->where($where)->limit(100)->select();
-
-        if (!$list) {
-            echo 'mei shu ju';
-            die;
-        }
-
-        //上周开始时间 上周结束时间
-        $starttime = $week_start_time - 604800;
-        $endtime = $week_start_time - 1;
-
-        $money_map['log_type'] = ['in', [21, 22, 23, 54, 60, 82]];
-        $money_map['createtime'] = ['between', [$starttime, $endtime]];
-
-        $mt_user_money_log = Db::name('user_money_log');
-        $mt_user = Db::name('user');
-        $mt_extend_reward = Db::name('extend_reward');
-        $issuingtime = time();
-        foreach ($list as $k => &$v) {
-            //开启事务
-            Db::startTrans();
-            //修改记录状态
-            $rs = $mt_admin->where(['id' => $v['id'], 'issuingtime' => $v['issuingtime']])->setField('issuingtime', $issuingtime);
-            if (!$rs) {
-                Db::rollback();
-                continue;
-            }
-
-            $user_ids = $mt_user->where(['intro_uid' => $v['user_id']])->column('id');
-            if ($user_ids) {
-                $money_map['user_id'] = ['in', $user_ids];
-                //周收益
-                $week_sum_money = $mt_user_money_log->where($money_map)->sum('change_value');
-                $week_sum_money = $week_sum_money > 0 ? $week_sum_money : 0;
-                if ($week_sum_money) {
-                    //查询推广奖励等级
-                    $extend_reward_info = $mt_extend_reward->where(['total_flow' => ['elt', $week_sum_money]])->order('id desc')->find();
-                    if ($extend_reward_info) {
-                        //额外提成
-                        $extra_moeny = number_format($week_sum_money * $extend_reward_info['extra_reward'] / 100, 2, '.', '');
-                        if ($extra_moeny > 0) {
-                            //发放额外提出
-                            $wallet_rs = model('wallet')->lockChangeAccountRemain($v['user_id'],0,'money',$extra_moeny,91,'额外提成奖励');
-                            if($wallet_rs['status'] === false){
-                                Db::rollback();
-                            } else {
-                                //发送系统消息
-                                \app\common\model\Message::addMessage($v['user_id'],'额外提成奖励','上周额外提成奖励已经发放');
-                            }
-                        }
-                    }
-                }
-            }
-
-            Db::commit();
-        }
-
-        echo 'wan bi';
-        die;
-    }
-
-
-
-    //自动推荐。 没用到
-    public function auto_userRecommend()
-    {
-        $payMoney = config('site.recommend_pay_money');//财富值
-        $getMoney = config('site.recommend_get_money');//魅力值
-        if ($payMoney <= 0 && $getMoney <= 0) {
-            echo 'empty';exit;
-        }
-        $where = 'u.is_recommend = 0 ';
-        $whereAppend = '';
-        if ($payMoney > 0) {
-            $whereAppend = $where.' and uw.pay_money >= '.$payMoney;
-        }
-        if ($getMoney > 0) {
-            $whereAppend = $where.' and uw.get_money >= '.$getMoney;
-        }
-        if ($payMoney >0 && $getMoney >0) {
-            $whereAppend = $where. ' and (uw.pay_money >= '.$payMoney.' or uw.get_money >= '.$getMoney.')' ;
-        }
-
-        $user = Db::name('user')->alias('u')->field('u.id')
-            ->join('user_wallet uw','uw.user_id = u.id','LEFT')
-            ->where($whereAppend)
-            ->select();
-
-        if (empty($user)) {
-            echo 'update 0';exit;
-        }
-        $userIds = array_column($user,'id');
-        $userWhere['id'] = ['in',$userIds];
-        $userUpdateData['is_recommend'] = 1;
-        $userUpdateData['updatetime'] = time();
-        $userRes = Db::name('user')->where($userWhere)->update($userUpdateData);
-        echo 'update '.$userRes;exit;
-    }
 }