} } //同一个Mbr安装的次数 foreach ($reser as $k => $v) { for ($i = 0; $i < count($v); $i++) { $mbr[$k] = count($v); $c_mbr[] = count($v) . ',' . $k . ',' . $v[$i][1] . ',' . $data; } } for ($i = 0; $i < count($c_mbr); $i++) { $mbr_arr[] = explode(",", $c_mbr[$i]); } $redis = new redis(); $redis->connect("127.0.0.1", 6379); foreach ($mbr_arr as $key => $val) { $valus[] = $redis->hget("mbr", $val[2]); if ($vals) { $redis->hdel("mbr", $val[2]); $redis->hset("mbr", $val[2], json_encode($val)); } else { $redis->hset("mbr", $val[2], json_encode($val)); } } //print_r($redis->hgetall("mbr"));die; /* * Mac 安 装 量 */ for ($i = 0; $i < count($install); $i++) { $mac_arr[] = explode(",", $install[$i]); } foreach ($mac_arr as $a => $b) {