0 ) { $add_time = time(); M('lionfish_comshop_pop_adv')->where( array('id' => $id) )->save( $ins_data ); $aid = $_GPC['aid']; $thumb = $_GPC['thumb']; $adv_id = $_GPC['adv_id']; M('lionfish_comshop_pop_adv_list')->where( array('ad_id' => $id) )->delete(); for($i = 0;$i < count($aid);$i++){ $adv_data = array(); $adv_data['ad_id'] = $id; $adv_data['thumb'] = $thumb[$i]; $adv_data['link'] = $data['link_'.$aid[$i]]; $adv_data['linktype'] = $data['linktype_'.$aid[$i]]; $adv_data['appid'] = $data['appid_'.$aid[$i]]; $adv_data['addtime'] = $add_time; M('lionfish_comshop_pop_adv_list')->add($adv_data); } }else{ $add_time = time(); $ins_data['addtime'] = $add_time; $adv_id = M('lionfish_comshop_pop_adv')->add($ins_data); $aid = $_GPC['aid']; $thumb = $_GPC['thumb']; for($i = 0;$i < count($aid);$i++){ $adv_data = array(); $adv_data['ad_id'] = $adv_id; $adv_data['thumb'] = $thumb[$i]; $adv_data['link'] = $data['link_'.$aid[$i]]; $adv_data['linktype'] = $data['linktype_'.$aid[$i]]; $adv_data['appid'] = $data['appid_'.$aid[$i]]; $adv_data['addtime'] = $add_time; M('lionfish_comshop_pop_adv_list')->add($adv_data); } } } } ?>