Commit a3b5b54c by mushishixian

缓存问题

parent 160b215c
Showing with 3 additions and 3 deletions
......@@ -38,7 +38,7 @@ class IntracodeModel extends Model
public function getAllEncode()
{
$redis = new RedisModel();
$codeList = json_decode($redis->get('EncodedList_supplier'), true);
$codeList = json_decode($redis->get('EncodedList_all_supplier'), true);
if (!$codeList) {
$codeList = $this->where('admin_id', '>', 0)->join('user_info', 'lie_intracode.admin_id', '=', 'user_info.userId')
->select('code_id', 'admin_id', 'name', 'email')->get();
......@@ -49,8 +49,8 @@ class IntracodeModel extends Model
$v['name'] = $v['email'];
}
}
$redis->set('EncodedList_supplier', json_encode($codeList));
$redis->expire('EncodedList_supplier', 60 * 10);//缓存10分钟
$redis->set('EncodedList_all_supplier', json_encode($codeList));
$redis->expire('EncodedList_all_supplier', 60 * 10);//缓存10分钟
}
}
return $codeList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment