0 ) { unset($ins_data['addtime']); M('lionfish_comshop_solitaire')->where( array('id' => $id ))->save( $ins_data ); //shagnp shuju $limit_goods_str = $data['goods_list']; $limit_goods_list = explode(',', $limit_goods_str ); if( !empty($limit_goods_list) ) { M('lionfish_comshop_solitaire_goods')->where( 'id not in (' . $limit_goods_str.') and soli_id = '.$id )->delete(); foreach( $limit_goods_list as $goods_id ) { //新增 goods_ids $cai_data = array(); $cai_data['uniacid'] = $_W['uniacid']; $cai_data['soli_id'] = $id; $cai_data['goods_id'] = $goods_id; $cai_data['addtime'] = time(); $insid = M('lionfish_comshop_solitaire_goods')->add( $cai_data ); } } }else{ foreach( $data['head_id_list'] as $head_dan_id ) { $ins_data['head_id'] = $head_dan_id; $id = M('lionfish_comshop_solitaire')->add( $ins_data ); //判断商品是否存在,先删除一次不存在的, limit_goods_list $limit_goods_str = $data['goods_list']; $limit_goods_list = explode(',', $limit_goods_str ); if( !empty($limit_goods_list) ) { foreach( $limit_goods_list as $goods_id ) { //新增 goods_ids $cai_data = array(); $cai_data['uniacid'] = 0; $cai_data['soli_id'] = $id; $cai_data['goods_id'] = $goods_id; $cai_data['addtime'] = time(); $insid = M('lionfish_comshop_solitaire_goods')->add( $cai_data ); } } } } } } ?>