0 ) { unset($ins_data['id']); M('lionfish_comshop_salesroom_member')->where( array('id' => $id) )->save( $ins_data ); }else{ $ins_data['addtime'] = time(); $id = M('lionfish_comshop_salesroom_member')->add( $ins_data ); } if(!empty($data['salesroom_ids'])){ M('lionfish_comshop_salesroom_relative_member')->where( array('smember_id' => $id) )->delete(); $salesroom_ids = explode(',',$data['salesroom_ids']); $salesroom_relative_member = array(); $salesroom_relative_member['smember_id'] = $id; $salesroom_relative_member['member_id'] = $data['member_id']; $salesroom_relative_member['addtime'] = time(); foreach($salesroom_ids as $v){ $salesroom_relative_member['salesroom_id'] = $v; M('lionfish_comshop_salesroom_relative_member')->add( $salesroom_relative_member ); } } } } ?>