流星 2018-02-08 11:44:55 3178次浏览 0条评论 0 1 0
public function actionInserthashredis()
{
    $sql = "select isv_code, isv_name from ad_isv";
    $db = \Yii::$app->db;
    $data = $db->createCommand($sql)->queryAll();
    foreach ($data as $key => &$v) {
        $insertDatas[] = array(
            'isv_code' => $v['isv_code'],
            'isv_name' => $v['isv_name']
        );
        $hkey = $insertDatas[$key]['isv_code'];
        $hvalue = $insertDatas[$key]['isv_name'];
        \Yii::$app->redisLog->hset('cache_csv_isvcode',$hkey,$hvalue);
    }
}
觉得很赞
    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册