/** * 获取分类hash */ private function getCateHash() { $Category = D('Category'); $this->all_cate_list = $Category->where(['moduleid' => 5])->field(['catid', 'catname'])->select(); $this->all_cate_hash = Tools::toHashmap($this->all_cate_list, 'catid', 'catname'); }
/** * 获取资讯分类hash */ private function getCateHash() { $Category = D('Category'); $map['moduleid'] = ['in', [21, 23, 26]]; $this->all_information_list = $Category->where($map)->field(['catid', 'catname'])->select(); $this->all_information_hash = Tools::toHashmap($this->all_information_list, 'catid', 'catname'); }