🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### 通过模型的ID得到导入的必选规格属性 **位置:** Common\Lib\GoodsBaseLib.class.php **参数:** * @param $type_id int 模型ID * @return $attr_list array 模型的必填规格属性中文名 **调用:** * $goodsbase = new GoodsBaseLib(); * $type_attrs = $goodsbase->getPrintAttr($type_id, $attr_type); **完整代码:** ~~~ /** * 通过模型的ID得到导入的必选规格属性 * whz 2018-06-01 * @param $type_id int 模型ID * @return $attr_list array 模型的必填规格属性中文名 */ public function getMustAttr($type_id, $must) { $attr_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_must'=>$must, 'a.is_delete'=>0, 'b.is_delete'=>0)) ->select(); return $attr_list; } ~~~