update evaluation api;todo admin search

This commit is contained in:
callmeyan 2019-06-20 12:58:23 +08:00
parent 8a618da7ee
commit b65d0f7cfd
13 changed files with 366 additions and 19 deletions

View File

@ -1 +1 @@
APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = test USERNAME = username PASSWORD = password HOSTPORT = 3306 CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn
APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai ADMIN_MULTI_LOGIN = true [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = test USERNAME = username PASSWORD = password HOSTPORT = 3306 CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn

View File

@ -12,6 +12,7 @@ namespace app\controller;
use app\BaseController;
use app\model\AdminInfo;
use app\Request;
use app\service\AdminService;
use app\util\ErrorCode;
use app\util\ErrorResponse;
use app\util\StringUtil;
@ -19,7 +20,11 @@ use think\response\Json;
class Admin extends BaseController
{
public function postLogin()
protected $middleware = [
'\app\middleware\AdminApiCheck' => ['except' => ['login']],
];
public function login()
{
$username = $this->request->param("username");
$password = $this->request->param("password");
@ -29,7 +34,7 @@ class Admin extends BaseController
usleep(500000);
$user = AdminInfo::where('username', $username)->find();
if ($user->isEmpty()) {
if (empty($user) || $user->isEmpty()) {
return ErrorResponse::createError(ErrorCode::ERROR_ADMIN_LOGIN_PWD, '用户名或者密码错误(1)');
}
if ($user->password != md5($username . $user->salt)) {
@ -37,6 +42,9 @@ class Admin extends BaseController
}
$data = $user->getPartData(['id', 'username', 'email', 'avatar', 'last_login', 'sex']);
$user->save(['last_login' => time()]);
// 登录的token
$token = AdminService::createAdminToken($user);
$data['token'] = $token->token;
return Json::create($data);
}
@ -52,17 +60,17 @@ class Admin extends BaseController
);
}
$admin = $this->getCurrentLoginAdmin();
if (!$this->passwordIsCorrect($admin,$originPwd)){
if (!$this->passwordIsCorrect($admin, $originPwd)) {
return ErrorResponse::createError(
ErrorCode::ERROR_ADMIN_PWD_ERROR,'原始密码不正确'
ErrorCode::ERROR_ADMIN_PWD_ERROR, '原始密码不正确'
);
}
$salt = StringUtil::generateRandom(6);
$admin->save([
'password'=>StringUtil::getEncryptPassword($originPwd,$salt),
'password' => StringUtil::getEncryptPassword($originPwd, $salt),
'salt' => $salt
]);
return \json(['code'=>0]);
return \json(['code' => 0]);
}

View File

@ -21,6 +21,9 @@ use think\facade\Request;
class Evaluation extends ApiController
{
protected $middleware = [
'\app\middleware\AdminApiCheck' => ['only' => ['login']],
];
/**
* 用户创建评估记录
* @return \think\Response
@ -70,4 +73,9 @@ class Evaluation extends ApiController
$this->queryByUid($this->getCurrentUserInfo()->id)
);
}
public function search(){
return EvaluationService::search(EvaluationService::ResultAll);
}
}

View File

@ -0,0 +1,34 @@
<?php
/**
* Created by PhpStorm.
* User: home
* Date: 2019/6/20
* Time: 11:48
*/
namespace app\middleware;
use app\util\ErrorCode;
use app\util\ErrorResponse;
use think\Request;
class AdminApiCheck
{
public function handle(Request $request, \Closure $next)
{
$token = $request->param('token');//'wxaffadsf31Dfaf93';
if (empty($token)) {
return ErrorResponse::createError(
ErrorCode::ERROR_OPENID_REQUIRED, '缺失参数token'
);
}
//对于 admin -> token
//对于 user -> open_id
$response = $next($request);
return $response;
}
}

18
app/model/AdminToken.php Normal file
View File

@ -0,0 +1,18 @@
<?php
/**
* Created by PhpStorm.
* User: home
* Date: 2019/6/20
* Time: 11:36
*/
namespace app\model;
use app\BaseModel;
class AdminToken extends BaseModel
{
protected $pk = 'token';
protected $table = 'admin_token';
}

View File

@ -14,4 +14,10 @@ use app\BaseModel;
class EvaluationHistory extends BaseModel
{
protected $table = 'evaluation_history';
protected $globalScope = ['status'];
public function scopeStatus($query)
{
$query->where('status', 1);
}
}

View File

@ -14,4 +14,9 @@ use app\BaseModel;
class UserDetail extends BaseModel
{
protected $table = 'user_detail';
public function evaluations()
{
return $this->hasMany('EvaluationHistory', 'uid', 'uid');
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* Created by PhpStorm.
* User: home
* Date: 2019/6/20
* Time: 11:29
*/
namespace app\service;
use app\model\AdminInfo;
use app\model\AdminToken;
use think\facade\Config;
class AdminService
{
/**
* @param AdminInfo $adminInfo
* @return AdminToken
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function createAdminToken(AdminInfo $adminInfo)
{
$allowMultiLogin = Config::get("app.admin.multi_login", true);
$loginExpired = Config::get("app.admin.expired", 1800);
$data = [
'token' => md5($adminInfo->id . time()),
'admin_id' => $adminInfo->id,
'device_type' => 'web',
//过期时间
'expired_at' => date('Y-m-d H:i:s', time() + $loginExpired)
];
if ($allowMultiLogin) {
return AdminToken::create($data);
} else {
$token = AdminToken::where('admin_id', $adminInfo->id)->find();
if (empty($token)) {
return AdminToken::create($data);
}
$data['updated_at'] = date('Y-m-d H:i:s', time());
return AdminToken::update($data, ['admin_id' => $adminInfo->id]);
}
}
}

View File

@ -10,6 +10,7 @@ namespace app\service;
use app\model\EvaluationHistory;
use app\model\UserDetail;
use app\util\DataStatus;
use think\facade\Config;
@ -39,22 +40,25 @@ class EvaluationService
];
if (!empty($item)) {
$data = [
'score' => 0,
'options' => []
'score' => $item['score'],
'options' => [],
'create_time' => $item['create_time'],
];
foreach ($subjects as $key => $sub) {
$data['options'][] = array_merge([
'subject' => $sub['subject'],
], $sub['options'][$item[$key]]);
$data['score'] += $sub['options'][$item[$key]]['score'];
//$data['score'] += $sub['options'][$item[$key]]['score'];
}
$level = 0;
if ($data['score'] < 3) $level = 0;
elseif ($data['score'] <= 5) $level = 1;
elseif ($data['score'] <= 9) $level = 2;
else $level = 3;
if ($item['headache'] >= 1 && $item['score'] >= 3) {
if ($data['score'] < 3) $level = 0;
elseif ($data['score'] <= 5) $level = 1;
elseif ($data['score'] <= 9) $level = 2;
else $level = 3;
}
$data['result'] = $results[$level][0];
$data['create_time'] = $item['create_time'];
$data['suggest'] = $results[$level][1];
}
return $data;
@ -71,4 +75,35 @@ class EvaluationService
}
return $data;
}
}
const ResultAll = -1;
const ResultNone = 0;
const ResultLight = 1;
const ResultModerate = 2;
const ResultSerious = 3;
const SortByTime = 'create_time';
const SortByScore = 'score';
public static function search(int $result = self::ResultAll, string $username = null, string $sort = null, $page = 1, $pageSize = 20)
{
if (empty($sort) || !in_array($sort, [self::SortByTime, self::SortByScore])) {
$sort = self::SortByTime;
}
//全部结构范围
$resultType = [0, 12];
if ($result == self::ResultNone) $resultType = [0, 2];
if ($result == self::ResultLight) $resultType = [3, 5];
if ($result == self::ResultModerate) $resultType = [6, 9];
if ($result == self::ResultSerious) $resultType = [10, 12];
$querySQL = 'SELECT u.realname,e.* FROM `user_detail` u,evaluation_history e where 1=1';
$modelWhere = EvaluationHistory::where('status', '>=', $resultType[0])
->where('score', '<=', $resultType[1]);
if ($username) {
$modelWhere->where('realname', 'like', "%{$username}%");
}
return UserDetail::hasWhere('evaluations', $modelWhere)->limit(($page - 1) & $pageSize, $pageSize)->order($sort, 'desc')->select();
// return EvaluationHistory
}
}

View File

@ -44,7 +44,13 @@ return [
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => false,
'evaluation' => [
'subject' => include(__DIR__.'/evaluation_subject.php'),
'evaluation' => [
'subject' => include(__DIR__.'/evaluation_subject.php'),
],
'admin' =>[
'multi_login' => Env::get('app.admin_multi_login', true),
// 过期时间1小时
'expired' => 3600,
]
];

View File

@ -0,0 +1,15 @@
---------------------------------------------------------------
[2019-06-20T11:22:40+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ error ] [0]Call to a member function isEmpty() on null[C:\Users\home\dev\altitudereaction\api\app\controller\Admin.php:32]
---------------------------------------------------------------
[2019-06-20T12:36:21+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ error ] [0]语法错误: unexpected '}'[C:\Users\home\dev\altitudereaction\api\app\controller\Evaluation.php:80]
---------------------------------------------------------------
[2019-06-20T12:36:35+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ error ] [0]语法错误: unexpected 'return' (T_RETURN)[C:\Users\home\dev\altitudereaction\api\app\service\EvaluationService.php:95]
---------------------------------------------------------------
[2019-06-20T12:49:46+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/search
[ error ] [0]Argument 1 passed to think\Model::hasWhere() must be of the type string, object given, called in C:\Users\home\dev\altitudereaction\api\app\service\EvaluationService.php on line 104[C:\Users\home\dev\altitudereaction\api\vendor\topthink\framework\src\think\model\concern\RelationShip.php:207]
---------------------------------------------------------------
[2019-06-20T12:50:13+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/search
[ error ] [0]Argument 1 passed to think\db\BaseQuery::parseQueryWhere() must be an instance of think\db\concern\Query, instance of think\db\Query given, called in C:\Users\home\dev\altitudereaction\api\vendor\topthink\framework\src\think\db\concern\WhereQuery.php on line 31[C:\Users\home\dev\altitudereaction\api\vendor\topthink\framework\src\think\db\concern\WhereQuery.php:46]

View File

@ -19,3 +19,168 @@
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.013577s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `evaluation_history` [ RunTime:0.017088s ]
[ sql ] [ SQL ] SELECT * FROM `evaluation_history` WHERE `uid` = 1 AND `status` = 1 [ RunTime:0.008955s ]
---------------------------------------------------------------
[2019-06-20T11:14:07+08:00] 127.0.0.1 GET 127.0.0.1:8000/
[ sql ] [ DB ] CONNECT:[ UseTime:0.057004s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.015001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.013000s ]
---------------------------------------------------------------
[2019-06-20T11:14:11+08:00] 127.0.0.1 GET 127.0.0.1:8000/
[ sql ] [ DB ] CONNECT:[ UseTime:0.014001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.011000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.004001s ]
---------------------------------------------------------------
[2019-06-20T11:14:27+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation
[ sql ] [ DB ] CONNECT:[ UseTime:0.002000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
---------------------------------------------------------------
[2019-06-20T11:14:35+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.006001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `evaluation_history` [ RunTime:0.005001s ]
[ sql ] [ SQL ] SELECT * FROM `evaluation_history` WHERE `uid` = 1 AND `status` = 1 [ RunTime:0.004000s ]
---------------------------------------------------------------
[2019-06-20T11:18:25+08:00] 127.0.0.1 POST 127.0.0.1:8000/user/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.011001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.011001s ]
---------------------------------------------------------------
[2019-06-20T11:18:26+08:00] 127.0.0.1 GET 127.0.0.1:8000/news/hot?
[ sql ] [ DB ] CONNECT:[ UseTime:0.005000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.005001s ]
---------------------------------------------------------------
[2019-06-20T11:18:36+08:00] 127.0.0.1 GET 127.0.0.1:8000/admin/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.004000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003000s ]
---------------------------------------------------------------
[2019-06-20T11:18:40+08:00] 127.0.0.1 GET 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.010000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.007001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003000s ]
---------------------------------------------------------------
[2019-06-20T11:18:54+08:00] 127.0.0.1 GET 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.002000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.005001s ]
---------------------------------------------------------------
[2019-06-20T11:20:41+08:00] 127.0.0.1 GET 127.0.0.1:8000/news/hot?
[ sql ] [ DB ] CONNECT:[ UseTime:0.014001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003000s ]
---------------------------------------------------------------
[2019-06-20T11:21:09+08:00] 127.0.0.1 GET 127.0.0.1:8000/news/hot?
[ sql ] [ DB ] CONNECT:[ UseTime:0.002000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.002001s ]
---------------------------------------------------------------
[2019-06-20T11:22:40+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.018001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.012001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003000s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.005001s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'aasdf' LIMIT 1 [ RunTime:0.006000s ]
---------------------------------------------------------------
[2019-06-20T11:23:31+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.016001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.007001s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.008001s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'aasdf' LIMIT 1 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T11:23:42+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.011001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.006000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.002001s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.011001s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'aasdf' LIMIT 1 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T11:24:53+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.003000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.068004s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'admin' LIMIT 1 [ RunTime:0.002000s ]
[ sql ] [ SQL ] UPDATE `admin_info` SET `last_login` = 1561001093 WHERE `id` = 4 [ RunTime:0.007001s ]
---------------------------------------------------------------
[2019-06-20T11:24:58+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.011001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'admin' LIMIT 1 [ RunTime:0.012001s ]
[ sql ] [ SQL ] UPDATE `admin_info` SET `last_login` = 1561001098 WHERE `id` = 4 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T11:47:56+08:00] 127.0.0.1 POST 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.003000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003001s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_info` [ RunTime:0.008001s ]
[ sql ] [ SQL ] SELECT * FROM `admin_info` WHERE `username` = 'admin' LIMIT 1 [ RunTime:0.007000s ]
[ sql ] [ SQL ] UPDATE `admin_info` SET `last_login` = 1561002476 WHERE `id` = 4 [ RunTime:0.010001s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `admin_token` [ RunTime:0.007001s ]
[ sql ] [ SQL ] INSERT INTO `admin_token` SET `token` = '58cb684985357420ec275ae242682dd8' , `admin_id` = 4 , `device_type` = 'web' , `expired_at` = '2019-06-20 12:47:56' [ RunTime:0.007000s ]
---------------------------------------------------------------
[2019-06-20T11:47:58+08:00] 127.0.0.1 GET 127.0.0.1:8000/news/hot?
[ sql ] [ DB ] CONNECT:[ UseTime:0.007000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.007000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.004001s ]
---------------------------------------------------------------
[2019-06-20T11:53:26+08:00] 127.0.0.1 GET 127.0.0.1:8000/admin/login
[ sql ] [ DB ] CONNECT:[ UseTime:0.020001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.010001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T11:53:35+08:00] 127.0.0.1 GET 127.0.0.1:8000/admin/updatePwd
[ sql ] [ DB ] CONNECT:[ UseTime:0.004000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.005000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.003000s ]
---------------------------------------------------------------
[2019-06-20T12:06:33+08:00] 127.0.0.1 GET 127.0.0.1:8000/news/hot?
[ sql ] [ DB ] CONNECT:[ UseTime:0.005000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.010001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.009000s ]
---------------------------------------------------------------
[2019-06-20T12:36:21+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.006001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.007000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.004000s ]
---------------------------------------------------------------
[2019-06-20T12:36:35+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.011001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.020001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.004000s ]
---------------------------------------------------------------
[2019-06-20T12:37:46+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.011001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `evaluation_history` [ RunTime:0.004001s ]
[ sql ] [ SQL ] SELECT * FROM `evaluation_history` WHERE `status` = 1 AND `uid` = 1 AND `status` = 1 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T12:38:01+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.011000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.002001s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `evaluation_history` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `evaluation_history` WHERE `status` = 1 AND `uid` = 1 AND `status` = 1 [ RunTime:0.002000s ]
---------------------------------------------------------------
[2019-06-20T12:38:17+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/all
[ sql ] [ DB ] CONNECT:[ UseTime:0.012000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `evaluation_history` [ RunTime:0.010000s ]
[ sql ] [ SQL ] SELECT * FROM `evaluation_history` WHERE `status` = 1 AND `uid` = 1 AND `status` = 1 [ RunTime:0.002001s ]
---------------------------------------------------------------
[2019-06-20T12:49:46+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/search
[ sql ] [ DB ] CONNECT:[ UseTime:0.005000s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.012001s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.001000s ]
---------------------------------------------------------------
[2019-06-20T12:50:13+08:00] 127.0.0.1 GET 127.0.0.1:8000/evaluation/search
[ sql ] [ DB ] CONNECT:[ UseTime:0.021001s ] mysql:host=192.168.10.123;port=13306;dbname=altitude_reaction;charset=utf8
[ sql ] [ SQL ] SHOW FULL COLUMNS FROM `user_info` [ RunTime:0.004000s ]
[ sql ] [ SQL ] SELECT * FROM `user_info` WHERE `open_id` = 'wxaffadsf31Dfaf93' LIMIT 1 [ RunTime:0.007001s ]

View File

@ -1,5 +1,5 @@
<?php
// This cache file is automatically generated at:2019-06-19 15:42:50
// This cache file is automatically generated at:2019-06-20 08:46:34
declare (strict_types = 1);
return array (
);