Commit 68b6e897 by 杨树贤

分类修改

parent a74a4919
Showing with 14 additions and 5 deletions
......@@ -22,11 +22,11 @@ DB_Self_PORT=3306
DB_Self_PREFIX=lie_
//采购系统数据库
DB_Pur_HOST=192.168.1.232
DB_Pur_DATABASE=liexin_wms
DB_Pur_USERNAME=root
DB_Pur_PASSWORD=123456
DB_Pur_PORT=3306
DB_PUR_HOST=192.168.2.232
DB_PUR_DATABASE=liexin_wms
DB_PUR_USERNAME=liexin_wms
DB_PUR_PASSWORD=liexin_wms#zsyM
DB_PUR_PORT=3306
DB_Pur_PREFIX=lie_
......
......@@ -52,7 +52,14 @@ class SelfClassifyModel extends Model
public function getClassList()
{
$classificationsExpireMinute = 5;
//先去缓存里面取
$Redis = new RedisModel;
$classList = $Redis->hgetall('Self_SelfClassInfo');
$classList = array_map(function ($value) {
return json_decode($value, true);
}, $classList);
if (!$classList) {
return Cache::remember('classList', $classificationsExpireMinute, function () {
$field = [
'class_id',
......@@ -70,4 +77,6 @@ class SelfClassifyModel extends Model
->orderBy('sort', 'desc')->get()->toArray();
});
}
}
}
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