|
|
@@ -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
|