💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 通过模型的ID得到打吊牌的规格属性中文名 **位置:** Common\Lib\GoodsBaseLib.class.php **参数:** * @param $type_id int 模型ID * @param $attr_type int 属性类型(1.商品属性,2.商品规格) * @return $attr_arr array 模型的规格或属性中文名 **调用:** * $goodsbase = new GoodsBaseLib(); * $type_attrs = $goodsbase->getPrintAttr($type_id, $attr_type); **完整代码:** ~~~ /** * 通过模型的ID得到打吊牌的规格属性中文名 * whz 2018-05-07 * @param $type_id int 模型ID * @param $attr_type int 属性类型(1.商品属性,2.商品规格) * @return $attr_arr array 模型的规格或属性中文名 */ public function getPrintAttr($type_id, $attr_type) { $specs_list = M('goods_attr_type as a') ->field('b.attr_name') ->join('coscia_goods_attribute as b on a.attr_id = b.id','left') ->where(array('a.type_id'=>$type_id, 'b.is_print'=>1, 'a.is_delete'=>0, 'b.is_delete'=>0, 'b.attr_type'=>$attr_type)) ->select(); return $specs_list; } ~~~