public function voucher_listOp() { //检查过期的代金券,状态设置为过期(vouchet_state=3) $this->check_voucher_expire(); $model = Model(); $where = array('voucher_owner_id' => $_SESSION['member_id']); if (intval($_GET['select_detail_state']) > 0) { $where['voucher_state'] = intval($_GET['select_detail_state']); } $field = "voucher_id,voucher_code,voucher_title,voucher_desc,voucher_start_date,voucher_end_date,voucher_price,voucher_limit,voucher_state,voucher_order_id,voucher_store_id,store_name,store_id,store_domain,voucher_t_customimg"; $list = $model->table('voucher,store,voucher_template')->field($field)->join('inner,inner')->on('voucher.voucher_store_id = store.store_id,voucher.voucher_t_id=voucher_template.voucher_t_id')->where($where)->order('voucher_id desc')->page(10)->select(); if (is_array($list)) { foreach ($list as $key => $val) { if (empty($val['voucher_t_customimg']) || !file_exists(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $val['store_id'] . DS . $val['voucher_t_customimg'])) { $list[$key]['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . defaultGoodsImage(60); } else { $list[$key]['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . ATTACH_VOUCHER . DS . $val['store_id'] . DS . str_ireplace('.', '_small.', $val['voucher_t_customimg']); } } } Tpl::output('list', $list); Tpl::output('show_page', $model->showpage(2)); //查询会员信息 $this->get_member_info(); $this->profile_menu('voucher_list'); Tpl::output('menu_sign', 'myvoucher'); Tpl::output('menu_sign_url', 'index.php?act=member_voucher'); Tpl::output('menu_sign1', 'member_voucher'); Tpl::showpage('member_voucher.list'); }
public function indexOp() { $model = Model(); //开启代金券功能后查询代金券相应信息 if (C('voucher_allow') == 1) { //查询已兑换代金券券数量 $vouchercount = 0; if ($_SESSION['is_login'] == '1') { $vouchercount = $model->table('voucher')->where(array('voucher_owner_id' => $_SESSION['member_id'], 'voucher_state' => $this->voucherstate_arr['unused'][0]))->count(); } Tpl::output('vouchercount', $vouchercount); //查询代金券面额 $pricelist = $model->table('voucher_price')->order('voucher_price asc')->select(); Tpl::output('pricelist', $pricelist); //查询代金券列表 $field = 'voucher_template.*,store.store_id,store.store_label,store.store_name,store.store_domain'; $on = 'voucher_template.voucher_t_store_id=store.store_id'; $new_voucher = $model->table('voucher_template,store')->field($field)->join('left')->on($on)->where(array('voucher_t_state' => $this->templatestate_arr['usable'][0], 'voucher_t_end_date' => array('gt', time())))->limit(16)->select(); if (!empty($new_voucher)) { foreach ($new_voucher as $k => $v) { if (!empty($v['voucher_t_customimg'])) { $v['voucher_t_customimg'] = SiteUrl . DS . ATTACH_VOUCHER . DS . $v['voucher_t_store_id'] . DS . $v['voucher_t_customimg'] . "_small." . get_image_type($v['voucher_t_customimg']); } else { $v['voucher_t_customimg'] = defaultGoodsImage('small'); } if (!empty($v['store_label'])) { $v['store_label'] = SiteUrl . DS . ATTACH_STORE . DS . $v['store_label']; } $v['voucher_t_limit'] = intval($v['voucher_t_limit']); $new_voucher[$k] = $v; } } Tpl::output('new_voucher', $new_voucher); } //开启积分兑换功能后查询代金券相应信息 if (C('pointprod_isuse') == 1) { //最新积分兑换商品 $model_pointsprod = Model('pointprod'); $new_pointsprod = $model_pointsprod->getPointProdListNew('*', array('pgoods_show' => 1, 'pgoods_state' => 0), 'pgoods_sort asc,pgoods_id desc', 16); Tpl::output('new_pointsprod', $new_pointsprod); //兑换排行 $converlist = $model_pointsprod->getPointProdListNew('*', array('pgoods_show' => 1, 'pgoods_state' => 0), 'pgoods_salenum desc,pgoods_id desc', 3); Tpl::output('converlist', $converlist); } //SEO Model('seo')->type('point')->show(); Tpl::showpage('pointprod'); }
/** * 代金券列表 */ public function pointvoucherOp() { $model = Model(); //查询会员信息 $member_info = $model->table('member')->field('member_points')->where(array('member_id' => $_SESSION['member_id']))->find(); Tpl::output('member_info', $member_info); //查询已兑换代金券券数量 $vouchercount = 0; if ($_SESSION['is_login'] == '1') { $vouchercount = $model->table('voucher')->where(array('voucher_owner_id' => $_SESSION['member_id'], 'voucher_state' => $this->voucherstate_arr['unused'][0]))->count(); } Tpl::output('vouchercount', $vouchercount); //查询代金券面额 $pricelist = $model->table('voucher_price')->order('voucher_price asc')->select(); $voucherlist = array(); if (!empty($pricelist)) { foreach ($pricelist as $k => $v) { $voucherlist[$v['voucher_price']]['price'] = $v; } } //查询代金券列表 $field = 'voucher_template.*,store.store_id,store.store_label,store.store_name,store.store_domain'; $on = 'voucher_template.voucher_t_store_id=store.store_id'; $voucher = $model->table('voucher_template,store')->field($field)->join('left')->on($on)->where(array('voucher_t_state' => $this->templatestate_arr['usable'][0], 'voucher_t_end_date' => array('gt', time())))->select(); if (!empty($voucher)) { foreach ($voucher as $k => $v) { if (!empty($v['voucher_t_customimg'])) { $v['voucher_t_customimg'] = SiteUrl . DS . ATTACH_VOUCHER . DS . $v['voucher_t_store_id'] . DS . $v['voucher_t_customimg'] . "_small." . get_image_type($v['voucher_t_customimg']); } else { $v['voucher_t_customimg'] = defaultGoodsImage('small'); } if (!empty($v['store_label'])) { $v['store_label'] = SiteUrl . DS . ATTACH_STORE . DS . $v['store_label']; } $v['voucher_t_limit'] = intval($v['voucher_t_limit']); if (!empty($voucherlist[$v['voucher_t_price']])) { $voucherlist[$v['voucher_t_price']]['voucher'][] = $v; } } } Tpl::output('voucherlist', $voucherlist); Tpl::showpage('pointvoucher'); }
p_li.find('img:first').attr('src','<?php echo defaultGoodsImage('tiny'); ?> '); p_li.find('*[nc_type="handler"]').hide().css('z-index', '0'); img_handle(); } }); }); }); function img_handle(){ $('*[nc_type="handle_pic"]').each(function(){ $(this).unbind(); if($(this).find('img:first').attr('src') != '<?php echo defaultGoodsImage('tiny'); ?> '){ $(this).hover(function(){ var obj = $(this).find('img:first'); handler = $(this).find('*[nc_type="handler"]'); handler.show(); handler.hover(function(){ set_zindex($(this), "999"); }, function(){ set_zindex($(this), "0"); }); set_zindex($(this), '999'); }, function(){
public function templateeditOp() { $t_id = intval($_GET['tid']); if ($t_id <= 0) { $t_id = intval($_POST['tid']); } if ($t_id <= 0) { showMessage(Language::get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } $model = Model('voucher'); //查询模板信息 $param = array(); $param['voucher_t_id'] = $t_id; $param['voucher_t_store_id'] = $_SESSION['store_id']; $param['voucher_t_state'] = $this->templatestate_arr['usable'][0]; $param['voucher_t_giveout'] = array('elt', '0'); $param['voucher_t_end_date'] = array('gt', time()); $t_info = $model->table('voucher_template')->where($param)->find(); if (empty($t_info)) { showMessage(Language::get('wrong_argument'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } if ($isOwnShop = checkPlatformStore()) { Tpl::output('isOwnShop', true); } else { //查询套餐信息 $quotainfo = $model->table('voucher_quota')->where(array('quota_id' => $t_info['voucher_t_quotaid'], 'quota_storeid' => $_SESSION['store_id']))->find(); if (empty($quotainfo)) { showMessage(Language::get('voucher_template_quotanull'), 'index.php?act=store_voucher&op=quotaadd', 'html', 'error'); } } //查询面额列表 $pricelist = $model->table('voucher_price')->order('voucher_price asc')->select(); if (empty($pricelist)) { showMessage(Language::get('voucher_template_pricelisterror'), 'index.php?act=store_voucher&op=templatelist', 'html', 'error'); } if (chksubmit()) { //验证提交的内容面额不能大于限额 $obj_validate = new Validate(); $obj_validate->validateparam = array(array("input" => $_POST['txt_template_title'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "50", "message" => Language::get('voucher_template_title_error')), array("input" => $_POST['txt_template_total'], "require" => "true", "validator" => "Number", "message" => Language::get('voucher_template_total_error')), array("input" => $_POST['select_template_price'], "require" => "true", "validator" => "Number", "message" => Language::get('voucher_template_price_error')), array("input" => $_POST['txt_template_limit'], "require" => "true", "validator" => "Double", "message" => Language::get('voucher_template_limit_error')), array("input" => $_POST['txt_template_describe'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Language::get('voucher_template_describe_error'))); $error = $obj_validate->validate(); //金额验证 $price = intval($_POST['select_template_price']) > 0 ? intval($_POST['select_template_price']) : 0; foreach ($pricelist as $k => $v) { if ($v['voucher_price'] == $price) { $chooseprice = $v; //取得当前选择的面额记录 } } if (empty($chooseprice)) { $error .= Language::get('voucher_template_pricelisterror'); } $limit = intval($_POST['txt_template_limit']) > 0 ? intval($_POST['txt_template_limit']) : 0; if ($price >= $limit) { $error .= Language::get('voucher_template_price_error'); } if ($error) { showDialog($error, 'reload', 'error'); } else { $update_arr = array(); $update_arr['voucher_t_title'] = trim($_POST['txt_template_title']); $update_arr['voucher_t_desc'] = trim($_POST['txt_template_describe']); if ($_POST['txt_template_enddate']) { $enddate = strtotime($_POST['txt_template_enddate']); if (!$isOwnShop && $enddate > $quotainfo['quota_endtime']) { $enddate = $quotainfo['quota_endtime']; } $update_arr['voucher_t_end_date'] = $enddate; } else { //如果没有添加有效期则默认为套餐的结束时间 if ($isOwnShop) { $update_arr['voucher_t_end_date'] = time() + 2592000; } else { $update_arr['voucher_t_end_date'] = $quotainfo['quota_endtime']; } } $update_arr['voucher_t_price'] = $price; $update_arr['voucher_t_limit'] = $limit; $update_arr['voucher_t_sc_id'] = intval($_POST['sc_id']); $update_arr['voucher_t_state'] = intval($_POST['tstate']) == $this->templatestate_arr['usable'][0] ? $this->templatestate_arr['usable'][0] : $this->templatestate_arr['disabled'][0]; $update_arr['voucher_t_total'] = intval($_POST['txt_template_total']) > 0 ? intval($_POST['txt_template_total']) : 0; $update_arr['voucher_t_points'] = $chooseprice['voucher_defaultpoints']; $update_arr['voucher_t_eachlimit'] = intval($_POST['eachlimit']) > 0 ? intval($_POST['eachlimit']) : 0; //自定义图片 if (!empty($_FILES['customimg']['name'])) { $upload = new UploadFile(); $upload->set('default_dir', ATTACH_VOUCHER . DS . $_SESSION['store_id']); $upload->set('thumb_width', '160'); $upload->set('thumb_height', '160'); $upload->set('thumb_ext', '_small'); $result = $upload->upfile('customimg'); if ($result) { //删除原图 if (!empty($t_info['voucher_t_customimg'])) { //如果模板存在,则删除原模板图片 @unlink(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg']); @unlink(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . str_ireplace('.', '_small.', $t_info['voucher_t_customimg'])); } $update_arr['voucher_t_customimg'] = $upload->file_name; } } $rs = $model->table('voucher_template')->where(array('voucher_t_id' => $t_info['voucher_t_id']))->update($update_arr); if ($rs) { showDialog(Language::get('nc_common_op_succ'), 'index.php?act=store_voucher&op=templatelist', 'succ'); } else { showDialog(Language::get('nc_common_op_fail'), 'index.php?act=store_voucher&op=templatelist', 'error'); } } } else { if (!$t_info['voucher_t_customimg'] || !file_exists(BASE_UPLOAD_PATH . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . $t_info['voucher_t_customimg'])) { $t_info['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . defaultGoodsImage(240); } else { $t_info['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . ATTACH_VOUCHER . DS . $_SESSION['store_id'] . DS . str_ireplace('.', '_small.', $t_info['voucher_t_customimg']); } TPL::output('type', 'edit'); TPL::output('t_info', $t_info); //店铺分类 $store_class = rkcache('store_class', true); Tpl::output('store_class', $store_class); //查询店铺详情 $store_info = Model('store')->getStoreInfoByID($_SESSION['store_id']); TPL::output('store_info', $store_info); TPL::output('quotainfo', $quotainfo); TPL::output('pricelist', $pricelist); $this->profile_menu('templateedit', 'templateedit'); Tpl::showpage('store_voucher_template.add'); } }
</div> <script src="<?php echo RESOURCE_SITE_URL; ?> /js/waypoints.js"></script> <script src="<?php echo SHOP_RESOURCE_SITE_URL; ?> /js/search_category_menu.js"></script> <script type="text/javascript"> var defaultSmallGoodsImage = '<?php echo defaultGoodsImage(240); ?> '; var defaultTinyGoodsImage = '<?php echo defaultGoodsImage(60); ?> '; $(function(){ $('#files').tree({ expanded: 'li:lt(2)' }); //浮动导航 waypoints.js $('#main-nav-holder').waypoint(function(event, direction) { $(this).parent().toggleClass('sticky', direction === "down"); event.stopPropagation(); }); // 单行显示更多 $('span[nc_type="show"]').click(function(){
/js/ajaxfileupload/ajaxfileupload.js" charset="utf-8"></script> <script src="<?php echo RESOURCE_SITE_URL; ?> /js/jquery.ajaxContent.pack.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo SHOP_RESOURCE_SITE_URL; ?> /js/store_goods_add.step3.js" charset="utf-8"></script> <script> var SITEURL = "<?php echo SHOP_SITE_URL; ?> "; var DEFAULT_GOODS_IMAGE = "<?php echo UPLOAD_SITE_URL . DS . defaultGoodsImage(240); ?> "; var SHOP_RESOURCE_SITE_URL = "<?php echo SHOP_RESOURCE_SITE_URL; ?> "; $(function(){ <?php if ($output['edit_goods_sign']) { ?> $('input[type="submit"]').click(function(){ ajaxpost('goods_image', '', '', 'onerror'); }); <?php }
/** * 获取运单图片地址 */ function getMbSpecialImageUrl($image_name = '') { $name_array = explode('_', $image_name); if (count($name_array) == 2) { $image_path = DS . ATTACH_MOBILE . DS . 'special' . DS . $name_array[0] . DS . $image_name; } else { $image_path = DS . ATTACH_MOBILE . DS . 'special' . DS . $image_name; } if (is_file(BASE_UPLOAD_PATH . $image_path)) { return UPLOAD_SITE_URL . $image_path; } else { return UPLOAD_SITE_URL . '/' . defaultGoodsImage('240'); } }
</div> <div class="clearfix"></div> </div> <!-- [//主体部分] --> <!-- [//列表页] --> <script src="<?php echo RESOURCE_SITE_URL;?>/js/waypoints.js"></script> <script src="<?php echo SHOP_RESOURCE_SITE_URL;?>/js/search_category_menu.js"></script> <script type="text/javascript"> var defaultSmallGoodsImage = '<?php echo defaultGoodsImage(240);?>'; var defaultTinyGoodsImage = '<?php echo defaultGoodsImage(60);?>'; $(function(){ $('#files').tree({ expanded: 'li:lt(2)' }); //浮动导航 waypoints.js $('#main-nav-holder').waypoint(function(event, direction) { $(this).parent().toggleClass('sticky', direction === "down"); event.stopPropagation(); }); // 单行显示更多 $('span[nc_type="show"]').click(function(){ s = $(this).parents('dd').prev().find('li[nc_type="none"]'); if(s.css('display') == 'none'){
function image_path($file, $type = '') { $type_array = explode(',_', ltrim(GOODS_IMAGES_EXT, '_')); if (!in_array($type, $type_array)) { $type = '240'; } if (empty($file)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } $search_array = explode(',', GOODS_IMAGES_EXT); $file = str_ireplace($search_array, '', $file); $fname = basename($file); // 本地存储时,增加判断文件是否存在,用默认图代替 if (!file_exists(BASE_UPLOAD_PATH . '/' . ATTACH_GOODS . '/' . $store_id . '/' . ($type == '' ? $file : str_ireplace('.', '_' . $type . '.', $file)))) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } $thumb_host = UPLOAD_SITE_URL . '/' . ATTACH_GOODS; return $thumb_host . '/' . $store_id . '/' . ($type == '' ? $file : str_ireplace('.', '_' . $type . '.', $file)); if (!file_exists(UPLOAD_SITE_URL . '/' . 'shop/common/' . $file)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } return UPLOAD_SITE_URL . '/' . 'shop/common/' . $file; }
function getMicroshopDefaultImage() { return UPLOAD_SITE_URL . '/' . defaultGoodsImage('240'); }
</tr> <?php foreach ($output['prod_list'] as $v) { ?> <tr> <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><a href="<?php echo SiteUrl; ?> /index.php?act=pointprod&op=pinfo&id=<?php echo $v['point_goodsid']; ?> " target="_blank" class="order_info_pic"> <img src="<?php echo SiteUrl . DS . ATTACH_POINTPROD . DS . $v['point_goodsimage'] . '_small.' . get_image_type($v['point_goodsimage']); ?> " onerror="this.src='<?php echo SiteUrl . DS . defaultGoodsImage('tiny'); ?> '" onload="javascript:DrawImage(this,56,56);" /></a></span></div></td> <td class="w50pre"><a href="<?php echo SiteUrl; ?> /index.php?act=pointprod&op=pinfo&id=<?php echo $v['point_goodsid']; ?> " target="_blank"><?php echo $v['point_goodsname']; ?> </a></td> <td><?php echo $v['point_goodspoints']; ?>
function wcthumb($file, $type = '', $store_id) { // $type_array = explode(',_', ltrim(GOODS_IMAGES_EXT, '_')); // if (!in_array($type, $type_array)) { // $type = '240'; // } if (empty($file)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } // if (empty($work['sn_work_pic'])) { // return UPLOAD_SITE_URL.'/'.defaultGoodsImage($type); // } // // exit('1'); //$search_array = explode(',', GOODS_IMAGES_EXT); // $file = str_ireplace($search_array,'',$work['sn_work_pic']); // $fname = basename($file); // // // if (preg_match('/^(\d+_)/',$fname)){ // $user_id = substr($fname,0,strpos($fname,'_')); // }else{ // $user_id = $work['sn_store_id']; // } //// return BASE_UPLOAD_PATH.'/'.ATTACH_DWORK.'/'.$user_id.'/'.$file; //// exit(); // // $file = $type == '' ? $file : str_ireplace('.', '_' . $type . '.', $file); if (!file_exists(BASE_UPLOAD_PATH . '/' . ATTACH_WORK . '/' . $file)) { // exit('1'); return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } $thumb_host = UPLOAD_SITE_URL . '/' . ATTACH_WORK; return $thumb_host . '/' . $file; }
/** * 取得积分商品缩略图的完整URL路径 * * @param string $imgurl 商品名称 * @param string $type 缩略图类型 值为small * @return string */ function pointprodThumb($image_name = '', $type = '') { if (!in_array($type, array('small', 'mid'))) { $type = ''; } if (empty($image_name)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage('240'); } if ($type) { $file_path = ATTACH_POINTPROD . DS . str_ireplace('.', '_' . $type . '.', $image_name); } else { $file_path = ATTACH_POINTPROD . DS . $image_name; } if (!file_exists(BASE_UPLOAD_PATH . DS . $file_path)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage('240'); } return UPLOAD_SITE_URL . DS . $file_path; }
?> " target="_blank" tile="<?php echo $v['pgoods_name']; ?> "><?php echo $v['pgoods_name']; ?> </a></dt> <dd class="gift-pic"><i></i> <a target="_blank" href="<?php echo SiteUrl . DS . 'index.php?act=pointprod&op=pinfo&id=' . $v['pgoods_id']; ?> "> <img src="<?php echo $v['pgoods_image']; ?> " onerror="this.src='<?php echo defaultGoodsImage('small'); ?> '" onload="javascript:DrawImage(this,160,160);" alt="<?php echo $v['pgoods_name']; ?> " /> </a></dd> <dd class="gift-price"><?php echo $lang['pointprod_goodsprice'] . $lang['nc_colon']; ?> <em><?php echo $lang['currency'] . $v['pgoods_price']; ?> </em></dd> <dd class="gift-pointpord"><?php echo $lang['pointprod_pointsname'] . $lang['nc_colon']; echo $v['pgoods_points'];
/** * 查询代金券模板列表 */ public function getVoucherTemplateList($where, $field = '*', $limit = 0, $page = 0, $order = '', $group = '') { $voucher_list = array(); if (is_array($page)) { if ($page[1] > 0) { $voucher_list = $this->table('voucher_template')->field($field)->where($where)->page($page[0], $page[1])->order($order)->group($group)->select(); } else { $voucher_list = $this->table('voucher_template')->field($field)->where($where)->page($page[0])->order($order)->group($group)->select(); } } else { $voucher_list = $this->table('voucher_template')->field($field)->where($where)->page($page)->order($order)->group($group)->select(); } //查询店铺分类 $store_class = rkcache('store_class', true); if (!empty($voucher_list) && is_array($voucher_list)) { foreach ($voucher_list as $k => $v) { if (!empty($v['voucher_t_customimg'])) { $v['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . ATTACH_VOUCHER . DS . $v['voucher_t_store_id'] . DS . $v['voucher_t_customimg']; } else { $v['voucher_t_customimg'] = UPLOAD_SITE_URL . DS . defaultGoodsImage(240); } $v['voucher_t_limit'] = intval($v['voucher_t_limit']); $v['voucher_t_sc_name'] = $store_class[$v['voucher_t_sc_id']]['sc_name']; $voucher_list[$k] = $v; } } return $voucher_list; }
/** * 取得团购缩略图的完整URL路径 * * @param string $imgurl 商品名称 * @param string $type 缩略图类型 值为small,mid,max * @return string */ function gthumb($imgurl = '', $type = '') { if (!in_array($type, array('small', 'mid', 'max'))) { $type = 'small'; } if (empty($imgurl)) { return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } $a = explode('.', $imgurl); $ext = end($a); $file = str_ireplace(array('_small.' . $ext, '_mid.' . $ext, '_max.' . $ext), '', $imgurl); $fname = basename($file); if (!file_exists(BASE_UPLOAD_PATH . '/' . ATTACH_GROUPBUY . '/' . $file . ($type == '' ? '' : '_' . $type . '.' . $ext))) { if (BASE_UPLOAD_PATH . '/' . ATTACH_GROUPBUY . '/' . $file . '_small' . $ext) { //向前兼容 return UPLOAD_SITE_URL . '/' . ATTACH_GROUPBUY . '/' . $file . '_small.' . $ext; } else { //文件不存在用默认图代替 return UPLOAD_SITE_URL . '/' . defaultGoodsImage($type); } } return UPLOAD_SITE_URL . '/' . ATTACH_GROUPBUY . '/' . $file . ($type == '' ? '' : '_' . $type . '.' . $ext); }