NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
### 通过模型的ID得到模型的规格属性ID **位置:** Common\Lib\GoodsBaseLib.class.php **参数:** * @param $type_id int 模型ID * @return $attr_arr array 模型的规格属性ID **调用:** * $goodsbase = new GoodsBaseLib(); * $type_attrs = $goodsbase->getAttrIdArray($type_id); **完整代码:** ~~~ /** * 通过模型的ID得到模型的规格属性ID * whz 2018-05-07 * @param $type_id int 模型ID * @return $attr_arr array 模型的规格属性ID */ public function getAttrIdArray($type_id) { $attr_arr = M('goods_attr_type') ->field('attr_id') ->where("type_id = '{$type_id}' AND is_delete = '0'") ->select(); return $attr_arr; } ~~~