0 ) { M('lionfish_comshop_spec')->where( array('id' => $id) )->save($ins_data); $id = $data['id']; }else{ M('lionfish_comshop_spec')->add($ins_data); $id = M('lionfish_comshop_spec')->getLastInsID(); } } public function get_all_spec($spec_type = 'normal') { $specs = M('lionfish_comshop_spec')->where(' spec_type="'.$spec_type.'"')->order('id asc')->select(); foreach($specs as $key => $val) { $val['value'] = unserialize($val['value']); if( !empty($val['value']) ) { $val['value_str'] = implode('@', $val['value']); }else{ $val['value_str'] = ''; } $specs[$key] = $val; } return $specs; } } ?>