$Model = new Model(); $sql = "SELECT a.id, a.attr_name, a.attr_input_type, a.attr_type, a.attr_values, v.attr_value, v.attr_price ". "FROM hh_typeattr AS a ". "LEFT JOIN hh_siteattr AS v ". "ON v.attr_id = a.id AND v.site_id = '$site_id' ". "WHERE a.type_id = " . intval($type_id) ." OR a.type_id = 0 ". "ORDER BY a.listorder, a.attr_type, a.id, v.attr_price, v.id"; $row = $Model->query($sql);
希望本文所述对大家的ThinkPHP框架程序设计有所帮助。