diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php
index fd34d69..e7a7bfe 100755
--- a/app/admin/controller/User.php
+++ b/app/admin/controller/User.php
@@ -19,6 +19,7 @@ use app\common\model\UserAccount;
use app\common\model\UserLoginIp;
use think\facade\Db;
use think\helper\Str;
+use app\common\server\RedisHelper;
class User extends Base
{
/**
@@ -207,9 +208,11 @@ class User extends Base
*/
public function usertest(Request $request)
{
+ $redis = new RedisHelper();
+ $redis->set('test', '123');
$id = request()->post('id/d', 0);
$type = request()->post('type/d', 0);
- if ($type != 1 && $type != 0) {
+ if ($type != 1 && $type != 0 && $type != 2) {
return $this->renderError('请求参数错误');
}
$user = UserModel::getInfo(['id' => $id]);
diff --git a/app/admin/view/User/index.html b/app/admin/view/User/index.html
index 2677d53..9f15548 100755
--- a/app/admin/view/User/index.html
+++ b/app/admin/view/User/index.html
@@ -141,11 +141,20 @@
推广账号
- {else /}
+ 测试账号
+ {/if}
+ {if condition="$vo['istest'] eq 1" /}
取消推广账号
{/if}
+ {if condition="$vo['istest'] eq 2" /}
+ 取消测试账号
+ {/if}
查看下级
redis = new \Redis();
+ $this->connect($host, $port);
+ }
+
+ private function connect($host, $port)
+ {
+ $this->redis->connect($host, $port);
+ }
+
+ public function get($key)
+ {
+ return $this->redis->get($key);
+ }
+
+ public function set($key, $value, $timeout = 0)
+ {
+ if ($timeout > 0) {
+ return $this->redis->setex($key, $timeout, $value);
+ }
+ return $this->redis->set($key, $value);
+ }
+
+ public function delete($key)
+ {
+ return $this->redis->del($key);
+ }
+
+ public function exists($key)
+ {
+ return $this->redis->exists($key);
+ }
+
+ public function expire($key, $timeout)
+ {
+ return $this->redis->expire($key, $timeout);
+ }
+
+}
\ No newline at end of file
diff --git a/app/config/redis.php b/app/config/redis.php
new file mode 100644
index 0000000..4874658
--- /dev/null
+++ b/app/config/redis.php
@@ -0,0 +1,8 @@
+ env('redis.host', '127.0.0.1'),
+ 'port' => env('redis.port', 6379),
+ 'password' => env('redis.password', ''),
+];