=7 or siteid=1) "; $userInfo = $DB_Ev123->get_row($sql); $user_id = $userInfo['userid'];$isProSource = 0; if ($user_id && SelfSpecial::rule4($user_id)) { $isProSource = 1; }if ($isProSource == 1 && $user_id) { $sql = "select * from ev_fenxiao.ap_fx_pro_rel where is_del=0 && user_id={$user_id} && my_pid={$id} limit 1"; $fxProRelInfo = Model_Public::querySql($sql, 'get_row', 'DB_FX'); $fxSourceProInfo = null; if ($fxProRelInfo && $fxProRelInfo['source_pid']) { $sql = "SELECT pid,userid FROM productchannel.proinfo WHERE pid={$fxProRelInfo['source_pid']} LIMIT 0,1"; $fxSourceProInfo = Model_Public::querySql($sql, 'get_row', 'DB_FX'); } $fxSourceUserInfo = null; if ($fxSourceProInfo) { if ($fxSourceProInfo['userid'] == $user_id) { $url = "/$user_name/products/{$fxProRelInfo['source_pid']}.html"; header('locations: '.$url); exit(); } $sql = "select userid,username from user where is_del=0 && userlevel>=3 && userid='{$fxSourceProInfo['userid']}'"; $fxSourceUserInfo = $DB_Ev123->get_row($sql); } $query_param = '?source_param='.$fxProRelInfo['user_id'].'_'.$fxProRelInfo['user_user_id'].'_'.$fxProRelInfo['my_pid']; if ($fxSourceUserInfo) { if (ENVIRONMENT == 'development') { $url = "http://{$fxSourceUserInfo['username']}.m.evyun.cn/{$fxSourceUserInfo['username']}/products/{$fxProRelInfo['source_pid']}.html{$query_param}"; header('locations: '.$url); exit(); } else { $sql = "SELECT id,host FROM website.`host_manage` WHERE is_del=0 && type=0 && is_main=1 && user_id={$fxSourceUserInfo['userid']}"; $fxSourceHostInfo = $DB_Ev123->get_row($sql); if ($fxSourceHostInfo) { $url = "http://{$fxSourceHostInfo['host']}/{$fxSourceUserInfo['username']}/products/{$fxProRelInfo['source_pid']}.html{$query_param}"; header('locations: '.$url); exit(); } } } } if (Job_Wap::check_wap() && $userInfo['used_mobiles'] && $userInfo['web_show_mobiles']) { $url = "/$user_name/wap_pro/$id.html"; header('locations: '.$url); exit(); }if ($user_id) { $sql = "select is_send from user_dingdan_set where user_id='".$user_id."'"; $is_store_send = $DB_Product->get_var($sql); $sql = "select id from ev_user_channel where userid='".$user_id."' and type=43"; $store_channel_id = $DB_Ev123->get_var($sql); $store_link = "/dom/user_store/user_store_list.php?username=".$user_name."&channel_id=".$store_channel_id; }if (!empty($userInfo['oa_id']) && $userInfo['oa_id'] != $user_id) { $oa_id = $userInfo['oa_id']; }if (!$id) { echo ''; exit(); }// 銷售數量 if (!defined('USER_ID')) { define("USER_ID", $user_id); }//訪問數據統計 General::recordGoodsUv($id, 1); if ($oa_id && !defined('PARENT_USER_ID')) { define("PARENT_USER_ID", $oa_id); }Model_Product::$user_id = $user_id; $info = Model_Product::getInfoNew(array(), 'pid='.$id);$live_id = $_REQUEST['live-id'] ? (int)$_REQUEST['live-id'] : 0; $source_param = $_REQUEST['source_param'] ? $_REQUEST['source_param'] : '';if (defined('PARENT_USER_ID') && PARENT_USER_ID && $info->userid == PARENT_USER_ID) { $chan_info = Model_Channel::getChannelInfo(PARENT_USER_ID, $info->channel_id); if ($chan_info['id'] && !defined('PARENT_CHANNEL_ID')) { define('PARENT_CHANNEL_ID', $chan_info['id']); } } else { $chan_info = Model_Channel::getChannelInfo($user_id, $info->channel_id); if ($chan_info['parent_id'] && !defined('PARENT_CHANNEL_ID')) { define('PARENT_CHANNEL_ID', $chan_info['parent_id']); } } if (!$chan_info) { echo ''; exit(); }Model_Product::$channel_id = $info->channel_id; $pro_arr = Model_Product::get_pro_detail($id); if ($pro_arr['proinfo']) { $pro_arr['proinfo'] = Model_Doc::re_reg($pro_arr['proinfo']); }if (!$pro_arr) { echo ''; exit(); }// 產品銷量總(zǒng)量 $sales_number = Model_Product::getProSalesVolume($id, USER_ID);$pro_arr['sale_num'] = $sales_number + $pro_arr['default_sale']; if (!$pro_arr) { echo ''; exit(); }// 產品品牌 if ($pro_arr['manu_id'] && USER_ID == 2036999) { $sql = "select name from ev_user_manu where is_del=0 and id=".$pro_arr['manu_id']; $pro_arr['manu_name'] = $DB_Ev123->get_var($sql); }$channel_id = $pro_arr['channel_id'];Model_Product::$channel_id = $channel_id;if (!empty($oa_id) && !empty($channel_id) && !empty($userInfo['allow_copy_channel'])) { $channel_id = Model_Channel::byParentGetChannelInfo($channel_id); }$con_class_table = get_class_con_table($user_id); $new_class_info = Model_Product::getClassInfoNew( $con_class_table, '', array('big_id' => 'big_id', 'sub_id' => 'sub_id', 'sub_sub_id' => 'sub_sub_id', 'sub_sub_sub_id' => 'sub_sub_sub_id' ), 'p.channel_id='.$channel_id.' and p.pro_id='.$id ); if ($new_class_info) { foreach ($new_class_info as $k => $v) { $big_id_arr[] = $v->big_id; $sub_id_arr[] = $v->sub_id; $sub_sub_id_arr[] = $v->sub_sub_id; } } $big_id = $pro_arr['big_id']; $sub_id = $pro_arr['sub_id']; $sub_sub_id = $pro_arr['use_sub_sub_id'];//驗證二級類和三級類是否顯示 if (defined('PARENT_USER_ID')) { Model_Product::$user_id = PARENT_USER_ID; } $class_sub = Model_Product::verifyClass(2, '', $big_id, 'id='.$sub_id); if (!$class_sub) { $sub_id = 0; } $class_sub_sub = Model_Product::verifyClass(3, '', $sub_id, 'id='.$sub_sub_id); if (!$class_sub_sub) { $sub_sub_id = 0; } Model_Product::$user_id = USER_ID; if (empty($pro_arr['city'])) { $pro_arr['city'] = '全國'; }if ($pro_arr['is_wap_add']) { $pro_arr['proinfo'] = ''; $pro_arr['proparameter'] = ''; $tmpCon = Model_Product::getWapAddContent($pro_arr['pid']); if ($tmpCon) { $tmpCon['proinfo'] = nl2br($tmpCon['proinfo']); $pro_arr['proinfo'] = '
'. $tmpCon['proinfo'] .'
'; $pro_arr['proparameter'] = $tmpCon['proparameter']; } }$tj_detail = 1; require_once(SYSTEM_ROOT.'include/public.php');if (ENVIRONMENT == 'development' && $user_name != UserColumnModel::USERNAME_1010061 && $user_name != UserColumnModel::USERNAME_248987 && 0) { } elseif ($info->user_userid && Job_Website::rule1($user_name)) { $user_power = []; $user_power['is_shops_user'] = Model_Public::get_user_power(54); // 商鋪是(shì)否開啟 $shops_isopen = Model_Public::getRow('ev_user_system', "userid=".$USERID, "DB_Ev123"); $user_power['shops_isopen'] = $shops_isopen->wap_shops;//商鋪是否開(kāi)啟 //我的微商鋪 $shops_info = Model_Shops::getShopsInfo($info->user_userid); if ($shops_info) { $is_pass = $shops_info->is_pass; } else { $is_pass = 0; } if (!$user_power['is_shops_user'] || !$user_power['shops_isopen'] || $is_pass != 1) { // 沒權限 } else { $shopUrl = WebsiteChUrlFn::getUrl([ 'type' => WebsiteChUrlFn::CH_TYPE_54_TYPE_1, 'chType' => EvUserChannelColumnModel::TYPE_54, 'username' => USER_NAME, 'id' => $id, 'UUId' => $info->user_userid, 'urlParamInfo' => [ 'live-id' => $live_id, 'source_param' => $source_param, 'pro_keyword' => SelfSpecial::rule27(USER_ID) ? $proKeyword : '', ], ]); header('HTTP/1.1 301 Moved Permanently'); header("locations: $shopUrl"); exit(); } }if ($user_tag->is_tj == 1) { $smarty->assign('login_alert_no', 0); $smarty->display('tjNew/index.tpl'); exit(); }if (!$channel_id) { echo ''; exit(); }//判斷(duàn)是否顯示按鈕 購(gòu)物車權限 if (defined("SHOPPING_CART")) { if (SHOPPING_CART == 2) {//顯示按(àn)鈕 $show_button = 1; } elseif (SHOPPING_CART == 1) { $show_button = 0; } } else { $show_button = 0; }if (defined('PARENT_USER_ID')) { $tmpUserWhere = ' OR s.userid ='.PARENT_USER_ID; } $sql="SELECT * FROM ev_user_channel as s WHERE s.id=".$channel_id." AND s.is_del=0 AND (s.userid=".$user_id.$tmpUserWhere.')'; $ch_info=$DB_Ev123->get_row($sql); $channel_id=$ch_info['id']; if (!$channel_id) { echo ''; exit(); } //當前商品清倉購信息 $clearanceInfo = Model_Clearance::getProductInfo($id); if ($clearanceInfo) { $pro_arr['is_trade_price'] = 0; $pro_arr['is_trade_dynamic_type'] = 0; $pro_arr['is_clearance'] = 1; $pro_arr['prosmallnum'] = $clearanceInfo->smallnum; // 最少購買數量 $pro_arr['prounitprice'] = $clearanceInfo->price; // 清倉價 $pro_arr['market_price'] = $clearanceInfo->proPrice; // 原價 } // 當前(qián)商品限時購信息 $timeBuyProInfo = Model_TimeBuy::thisProductMessage($id); if ($timeBuyProInfo->is_state == 3 || ($timeBuyProInfo->is_state == 1 && $timeBuyProInfo->start_set == 1)) { $timeBuyProInfo->divStyle = ' style="display:none;" '; }// 當為(wéi)顯示限時購商品信息時(shí),對某些數據進行(háng)初始化 if ($timeBuyProInfo->set_timebuy) { if ($timeBuyProInfo->is_state == 2 || ($timeBuyProInfo->is_state == 1 && $timeBuyProInfo->start_set == 2) || ($timeBuyProInfo->is_state == 3 && $timeBuyProInfo->end_set == 2) ) { $pro_arr['is_trade_price'] = 0; $pro_arr['is_trade_dynamic_type'] = 0; $pro_arr['propurveynum'] = $timeBuyProInfo->max_buy; // 庫存(cún) $pro_arr['prosmallnum'] = $timeBuyProInfo->smallnum; // 最(zuì)少(shǎo)購買數量 $pro_arr['prounitprice'] = $timeBuyProInfo->price; // 限(xiàn)時價 $pro_arr['market_price'] = $timeBuyProInfo->proPrice; // 原價 } if ($timeBuyProInfo->is_state == 1) { $timeBuyProInfo->explain = '開始限時購!'; } elseif ($timeBuyProInfo->is_state == 2) { $timeBuyProInfo->explain = '結束限時(shí)購!'; } elseif ($timeBuyProInfo->is_state == 3) { $timeBuyProInfo->explain = '限時購已結束!'; } $timeBuyProInfo->limitNum = "每人限(xiàn)購(gòu){$timeBuyProInfo->buyNum}個!"; } //當前產品的滿減信息 if ($info->full_cut_id && !$info->is_trade_price) { $fullCutInfo = Model_Product::getFullCutInfo($info->full_cut_id); if ($fullCutInfo) { $rule_arr = var_json_decode($fullCutInfo->rule); foreach ($rule_arr as $key => $value) { $fullCutInfo->html .= '滿¥'.format_price_new($value['full']).'減¥'.format_price_new($value['cut']).','; } $fullCutInfo->html = substr($fullCutInfo->html,0,-2); $fullCutInfo->url = '/'. $user_name .'/products/'.$channel_id.'_0_0_1.html?full_cut_id='.$info->full_cut_id; } $smarty->assign('fullCutInfo', $fullCutInfo); } //獲取商品限購信息(xī) $restrict_html = ''; $restrict_info = Model_OrderExtend::getRestritNum($id); if ($restrict_info['is_open'] == 1){ $restrict_html = '
限(xiàn)購'.$restrict_info['num'].'
'; } $smarty->assign('restrict_html', $restrict_html); //國電華瑞特殊處理 if ($model_id==314) { $proname_arr = str_replace("人和", "", str_replace("三信", "", $pro_arr['proname'])); $proname_all = str_replace("安恒", "國電華瑞", str_replace("泰亞賽福", "國電華瑞", $pro_arr['proinfo'])); $proname_all = str_replace("010-68589880", "010-68589880", $proname_all); $proname_all = str_replace("021-63176770", " ", $proname_all); $pattern ="/http:\/\/(.*).html/i"; $proname_all =preg_replace($pattern, " ", $proname_all); $sql ="select b.* from proinfo as a ,pro_pinpai as b where pid=".$id." and a.proname =b.name and a.channel_id=b.channel_id"; $duiying_pinpai =$DB_Product->get_row($sql); }//記錄訪問數 $tmp_ip=getIP2(); if ($pro_arr['last_ip']!=$tmp_ip && $tmp_ip) { /*$sql="update proinfo set last_ip='".$tmp_ip."',hits=hits+1 where pid=".$id." and userid=".$user_id; $DB_Product_W=new DB_Product_W; $DB_Product_W->query($sql);*/ }$tmp_pic = explode(";", $pro_arr['propicpath']); $pro_arr['pic'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic[0], 'width' => 600, 'height' => 600, 'field' => 'showPic', ] );$pro_arr['pic11'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic[0], 'width' => 150, 'height' => 150, 'field' => 'showPic', ] );$pro_arr['yuan_pic']=$pro_arr['pic'];$tmp_pic1 = explode(";", $pro_arr['propicpath2']);$pro_arr['pic1'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic1[0], 'width' => 600, 'height' => 600, 'field' => 'showPic', ] );$pro_arr['pic22'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic1[0], 'width' => 150, 'height' => 150, 'field' => 'showPic', ] );$tmp_pic2 = explode(";", $pro_arr['propicpath3']); $pro_arr['pic2'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic2[0], 'width' => 600, 'height' => 600, 'field' => 'showPic', ] );$pro_arr['pic33'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic2[0], 'width' => 150, 'height' => 150, 'field' => 'showPic', ] );$tmp_pic3 = explode(";", $pro_arr['propicpath4']); $pro_arr['pic3'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic3[0], 'width' => 600, 'height' => 600, 'field' => 'showPic', ] );$pro_arr['pic44'] = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_pic3[0], 'width' => 150, 'height' => 150, 'field' => 'showPic', ] );$pro_arr['market_price'] = format_price_new($pro_arr['market_price']); $pro_arr['price'] = trim($pro_arr['prounitprice']); $pro_arr['prounitprice'] = format_price_new($pro_arr['prounitprice']); if ($user_name=='bjyyw88') { $pro_arr['proinfo'] = str_replace('
', '', $pro_arr['proinfo']); $pro_arr['proinfo'] = str_replace('
', '', $pro_arr['proinfo']); } $pro_arr['proinfo'] = str_replace('0?$pro_arr['propurveynum']:0; $pro_arr['prosmallnum'] =$pro_arr['prosmallnum']>1?$pro_arr['prosmallnum']:1; if ($pro_arr['citycode']) { $sql = "select name from city where code='".$pro_arr['citycode']."' "; $pro_arr['city'] = $DB_Ev123->get_var($sql); }if ($pro_arr['manu_id']) { $sql = "select name from ev_user_manu where is_del=0 and id=".$pro_arr['manu_id']; $pro_arr['manu_name2'] = $DB_Ev123->get_var($sql); $pro_arr['manu_url'] = '/self_define/pro_list.php?username='.$user_name.'&manu_id='.$pro_arr['manu_id'] ; } if ($pro_arr['transaction_from_id'] != 0) { $sql="select name from ev_user_channel where is_del=0 and id = ".$pro_arr['transaction_from_id'] .' and userid = '.$USERID; $pro_arr['transaction_from_name']=$DB_Ev123->get_var($sql); if ($pro_arr['transaction_from_id'] && $pro_arr['transaction_from_name']) { $pro_arr['transaction_from_url']='/dom/form.php?channel_id='.$pro_arr['transaction_from_id'].'&username='.$user_name."&source=10$".$channel_id."$".$id; } } if ($pro_arr['transaction_from_id2'] != 0) { $sql="select name from ev_user_channel where is_del=0 and id = ".$pro_arr['transaction_from_id2'] .' and userid = '.$USERID; $pro_arr['transaction_from_name2']=$DB_Ev123->get_var($sql); if ($pro_arr['transaction_from_id2'] && $pro_arr['transaction_from_name2']) { $pro_arr['transaction_from_url2']='/dom/form.php?channel_id='.$pro_arr['transaction_from_id2'].'&username='.$user_name."&source=10$".$channel_id."$".$id; } } $big_name = get_proclass_name($big_id); if ($sub_id) { $sub_name = get_proclass_name($sub_id); } if ($sub_sub_id) { $sub_sub_name = get_proclass_name($sub_sub_id); } //$sub_name = $sub_name?$sub_name:$big_name;//得到頻道名 $info_arr = get_chan_name(' where id='.$channel_id); $name = $info_arr['name'];//獲得類信息 $sub_tmp_arr = get_class_info($user_id, $channel_id); $sub_class_arr = array(); $sub_num_arr = array(); if ($sub_tmp_arr) { $i = 1; foreach ($sub_tmp_arr as $sub) { $sub_class_arr[$sub['parentid']][$sub['id']] = cnsubstr($sub['classname'], 50); $sub_num_arr[$sub['parentid']]['num'] = $i; $sub_name_arr[$sub['id']]= $sub['classname']; $i++; } }//類(lèi)別(bié)----新寫 $class_arr=get_pro_class($user_id, $channel_id, '', ''); $big_class_arr=$class_arr[0]; $sub_class_arr2=$class_arr[1]; $sub_sub_class_arr=$class_arr[2]; $maxImg = $i; //獲得推薦(jiàn)購買產品 if($pro_arr['is_related']){ $commendList = Model_Product::get_commend_list($id); $com_width = (count($commendList)*215).'px'; $smarty->assign('commendList', $commendList); $smarty->assign('com_width', $com_width); } //獲得同類型產品 if (in_array($pro_arr['open_related'], array(2,3))) { Model_Product::$channel_id = $channel_id; $relatedWhere = ' 1 '; if ($big_id && $pro_arr['open_related'] == 2) { $relatedWhere .= ' && c.big_id='. $big_id; } elseif ($sub_id && $pro_arr['open_related'] == 3) { $relatedWhere .= ' && c.sub_id='. $sub_id; } if ($pro_arr['user_userid']) { $relatedWhere .= ' && p.user_userid='.$pro_arr['user_userid']; } $related_cnt = Model_Product::getProList( 1, array(), $relatedWhere, array(), array(), 1 ); if ($related_cnt) { $relatedWhere .= ' && p.pid!='. $id; $rec = Model_Product::getProList( 1, array( 'pid' => 'pid', 'brief' => 'brief', 'proname' => 'proname', 'createdate' => 'createdate', 'pro_no' => 'pro_no', 'market_price' => 'market_price', 'prounitprice' => 'prounitprice', 'prounit' => 'prounit', 'status' => 'status', 'propicpath' => 'propicpath', 'propicpath2' => 'propicpath2', 'propicpath3' => 'propicpath3', 'propicpath4' => 'propicpath4', 'is_blank' => 'is_blank', 'is_trade_price' => 'is_trade_price', ), $relatedWhere, array(), array(0, 10), 0 ); $pro_info_arr = array(); if ($rec) { $i = 1; foreach ($rec as $r) { $r = (array)$r; $pro_info_arr[$r['pid']]['proname'] = $r['proname']; $pro_info_arr[$r['pid']]['short_proname'] = cnsubstr($r['proname'], 10); $pro_info_arr[$r['pid']]['market_price'] = $r['market_price']; $pro_info_arr[$r['pid']]['prounitprice'] = $r['prounitprice']; $pro_info_arr[$r['pid']]['prounit'] = $r['prounit']; if ($r['propicpath']) { $tmp_arr = explode(";", $r['propicpath']); $savePic = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_arr[0], 'field' => 'savePic', ] ); $pro_info_arr[$r['pid']]['pic'] =Job_Pic::changePicSize(0, $savePic, 100, 80); $pro_info_arr[$r['pid']]['pic2'] =Job_Pic::changePicSize(0, $savePic, 200, 200); $pro_info_arr[$r['pid']]['pic3'] =Job_Pic::changePicSize(0, $savePic, 140, 75); $pro_info_arr[$r['pid']]['pic4'] =Job_Pic::changePicSize(0, $savePic, 150, 150); $pro_info_arr[$r['pid']]['pic5'] =Job_Pic::changePicSize(0, $savePic, 120, 90); } elseif ($r['propicpath2']) { $tmp_arr = explode(";", $r['propicpath2']); $savePic = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_arr[0], 'field' => 'savePic', ] ); $pro_info_arr[$r['pid']]['pic'] =Job_Pic::changePicSize(0, $savePic, 100, 80); $pro_info_arr[$r['pid']]['pic2'] =Job_Pic::changePicSize(0, $savePic, 200, 200); $pro_info_arr[$r['pid']]['pic3'] =Job_Pic::changePicSize(0, $savePic, 140, 75); $pro_info_arr[$r['pid']]['pic4'] =Job_Pic::changePicSize(0, $savePic, 150, 150); $pro_info_arr[$r['pid']]['pic5'] =Job_Pic::changePicSize(0, $savePic, 120, 90); } elseif ($r['propicpath3']) { $tmp_arr = explode(";", $r['propicpath3']); $savePic = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_arr[0], 'field' => 'savePic', ] ); $pro_info_arr[$r['pid']]['pic'] =Job_Pic::changePicSize(0, $savePic, 100, 80); $pro_info_arr[$r['pid']]['pic2'] =Job_Pic::changePicSize(0, $savePic, 200, 200); $pro_info_arr[$r['pid']]['pic3'] =Job_Pic::changePicSize(0, $savePic, 140, 75); $pro_info_arr[$r['pid']]['pic4'] =Job_Pic::changePicSize(0, $savePic, 150, 150); $pro_info_arr[$r['pid']]['pic5'] =Job_Pic::changePicSize(0, $savePic, 120, 90); } elseif ($r['propicpath4']) { $tmp_arr = explode(";", $r['propicpath4']); $savePic = Job_Pic::format( [ 'type' => 1, 'pic' => $tmp_arr[0], 'field' => 'savePic', ] ); $pro_info_arr[$r['pid']]['pic'] =Job_Pic::changePicSize(0, $savePic, 100, 80); $pro_info_arr[$r['pid']]['pic2'] =Job_Pic::changePicSize(0, $savePic, 200, 200); $pro_info_arr[$r['pid']]['pic3'] =Job_Pic::changePicSize(0, $savePic, 140, 75); $pro_info_arr[$r['pid']]['pic4'] =Job_Pic::changePicSize(0, $savePic, 150, 150); $pro_info_arr[$r['pid']]['pic5'] =Job_Pic::changePicSize(0, $savePic, 120, 90); } else { $pro_info_arr[$r['pid']]['pic'] = 'http://img.ev123.com/pic/detail2009/no_pic2.gif'; $pro_info_arr[$r['pid']]['pic2'] = 'http://img.ev123.com/pic/detail2009/no_pic.gif'; $pro_info_arr[$r['pid']]['pic3'] = 'http://img.ev123.com/pic/detail2009/no_pic.gif'; $pro_info_arr[$r['pid']]['pic4'] = 'http://img.ev123.com/pic/detail2009/no_pic.gif'; $pro_info_arr[$r['pid']]['pic5'] = 'http://img.ev123.com/pic/detail2009/no_pic2.gif'; } //兼容以前(qián)未壓縮的圖 if ($r['pid']<600000 && $pro_info_arr[$r['pid']]['pic']) { $pro_info_arr[$r['pid']]['pic5']=$pro_info_arr[$r['pid']]['pic']; } $pro_info_arr[$r['pid']]['num'] = $i; $i++; } $img_num = $i-1; $img_width = $img_num*232; } } }$focus_pic_str = get_pic_info($pro_arr); $new_focus_pic_str = array(); if ($focus_pic_str) { $i=0; foreach ($focus_pic_str as $key => $values) { $new_focus_pic_str[$i]['pic'] = $values['savePic']; $new_focus_pic_str[$i]['pic1'] = Job_Pic::changePicSize(0, $values['savePic'], 280, 210); $new_focus_pic_str[$i]['pic2'] = Job_Pic::changePicSize(0, $values['savePic'], 600, 600); $new_focus_pic_str[$i]['url'] = str_replace("200_200", "100_80", $values['url']); $i++; } $extendInfoNew = Model_Product::getExtendNewInfo($id, $channel_id, USER_ID); if ($extendInfoNew->propicpath5) { $tmpSavePic = Job_Pic::format( [ 'type' => 1, 'pic' => $extendInfoNew->propicpath5, 'field' => 'savePic', ] ); $new_focus_pic_str[] = array( 'pic' => $tmpSavePic, 'pic1' => Job_Pic::changePicSize(0, $tmpSavePic, 280, 280), 'pic2' => Job_Pic::changePicSize(0, $tmpSavePic, 600, 600), 'url' => "javascript:show_picbig('".Job_Pic::changePicSize(0, $tmpSavePic, 600, 600)."','".$pro_arr['proname']."'" ); } if ($extendInfoNew->propicpath6) { $tmpSavePic = Job_Pic::format( [ 'type' => 1, 'pic' => $extendInfoNew->propicpath6, 'field' => 'savePic', ] ); $new_focus_pic_str[] = array( 'pic' => $tmpSavePic, 'pic1' => Job_Pic::changePicSize(0, $tmpSavePic, 280, 280), 'pic2' => Job_Pic::changePicSize(0, $tmpSavePic, 600, 600), 'url' => "javascript:show_picbig('".Job_Pic::changePicSize(0, $tmpSavePic, 600, 600)."','".$pro_arr['proname']."'" ); } if ($extendInfoNew->propicpath7) { $tmpSavePic = Job_Pic::format( [ 'type' => 1, 'pic' => $extendInfoNew->propicpath7, 'field' => 'savePic', ] ); $new_focus_pic_str[] = array( 'pic' => $tmpSavePic, 'pic1' => Job_Pic::changePicSize(0, $tmpSavePic, 280, 280), 'pic2' => Job_Pic::changePicSize(0, $tmpSavePic, 600, 600), 'url' => "javascript:show_picbig('".Job_Pic::changePicSize(0, $tmpSavePic, 600, 600)."','".$pro_arr['proname']."'" ); } if ($extendInfoNew->propicpath8) { $tmpSavePic = Job_Pic::format( [ 'type' => 1, 'pic' => $extendInfoNew->propicpath8, 'field' => 'savePic', ] ); $new_focus_pic_str[] = array( 'pic' => $tmpSavePic, 'pic1' => Job_Pic::changePicSize(0, $tmpSavePic, 280, 280), 'pic2' => Job_Pic::changePicSize(0, $tmpSavePic, 600, 600), 'url' => "javascript:show_picbig('".Job_Pic::changePicSize(0, $tmpSavePic, 600, 600)."','".$pro_arr['proname']."'" ); } } if (27==$model_id) { $sql = "select tel,fax,mobiles,address from user where userid=".$user_id ; $user_info = $DB_Ev123->get_row($sql); if ($user_info['mobiles']) { $mobiles_arr = explode('
', $user_info['mobiles']); } $smarty->assign("user_info", $user_info); $smarty->assign("mobiles_arr", $mobiles_arr); } $ser_id=0; //廣(guǎng)告 $ad_arr=get_ad_info($user_id, $model_id, $channel_id, $ser_id); if ($ad_arr) { foreach ($ad_arr as $key => $val) { $smarty->assign('ad_'.$key, $val); } }//新的(de)頻道(dào)模板設置$css_filename = getDomTemplateColorById(getDomTemplateColorId((int)$user_id, 0, $channel_id)); $tel=str_replace('
', '  ', $user_info['tel']); //用戶自定(dìng)義參數 $pinlun_arr=array(); $used_review=0; $used_review_add=0; $fen_class='c-value-0'; if ($model_css) { if (defined('PARENT_CHANNEL_ID')) { $user_param=get_product_forget_param(PARENT_CHANNEL_ID, $pro_arr, 15); } else { $user_param=get_product_forget_param($channel_id, $pro_arr, 15); } if ($user_param) { foreach ($user_param as $k => $v) { if ($v['system_type'] == 7) {//供(gòng)貨數(shù)量 $show_kucun=1; break; } else { $show_kucun=0; } } foreach ($user_param as $k2 => $v2) { if ($v2['system_type'] == 8) {//最小定量 $show_zuixiao=1; break; } else { $show_zuixiao=0; } } foreach ($user_param as $k3 => $v3) { if ($v3['system_type'] == 4) {//價格 if ($v3['value']>0) { $show_danjia=0; } else { $show_danjia=1; } break; } else { $show_danjia=0; } } } if (defined('PARENT_CHANNEL_ID')) { $user_param2=get_product_forget_param(PARENT_CHANNEL_ID, $pro_arr, 20, 2); $guige_info = Job_GuiGe::get_guige_arr(PARENT_CHANNEL_ID, $pro_arr['pid']); } else { $user_param2=get_product_forget_param($channel_id, $pro_arr, 20, 2); $guige_info = Job_GuiGe::get_guige_arr($channel_id, $pro_arr['pid']); } if ($guige_info) {//驗證是否存在有效規格參數,沒有則視為無(wú)效規格 foreach ($guige_info as $key => $val) { if (!$val['val']) { unset($guige_info[$key]); continue; } $guige_info[$key] = $val; } } if ($guige_info) { foreach ($guige_info as $k => $v) { $tmp_param_ids[] = $v['id']; } rsort($tmp_param_ids); $guige_str = implode(',', $tmp_param_ids); $guige_sort = JSON($tmp_param_ids); $show_black = 1; } else { $show_black = 0; } $param_checked_ids = ''; if ($user_param2) { foreach ($user_param2 as $k => $v) { if ($v['value']) { empty($param_checked_ids) ? $param_checked_ids = $v['id'] : $param_checked_ids .= '#'. $v['id']; } } } if (defined('PARENT_USER_ID')) { $tmpUserIdWhere = ' OR user_id='.PARENT_USER_ID; } $sql="select used_review,used_review_add from user_dingdan_set where (user_id=".$user_id.$tmpUserIdWhere.')'; $used_review_info = $DB_Product->get_row($sql); $used_review = $used_review_info['used_review']; $used_review_add = $used_review_info['used_review_add']; if (SHOPPING_CART == 2) { if ($used_review!=2) { $sql="select * from user_pro_pinglun where pro_id=".$id." and site_id=1 and is_del=0 and is_add=0 order by id desc"; $pinlun_arr=$DB_Product->get_results($sql); if ($pinlun_arr) { $fen_count=0; $pin_count=0; foreach ($pinlun_arr as $key => &$pinlun) { $fen_count+=$pinlun['pro_fen']; $pin_count++; $sql="select user_name,nick_name from user_user where id=".$pinlun['user_user_id']; $tmp_info=$DB_Ev123->get_row($sql); $pinlun['username']=$tmp_info['nick_name']?$tmp_info['nick_name']:$tmp_info['user_name']; $pinlun['username']=cnsubstr($pinlun['username'], 1).'***'; if ($pinlun['pic']){ $tmp_pic_list = array(); $sql = 'select pic from wap_bbs_theme_image where user_id='.$USERID.' and is_del=0 and id in('.$pinlun['pic'].')'; $pic_list = $DB_Ev123->get_results($sql); foreach ($pic_list as $pic_k=>$p_v){ $tmp_pic_src = str_replace('/wap_bbs_theme/640_3000/', '/wap_bbs_theme/200_100/', $p_v['pic']); $big_pic_src = $p_v['pic']; if (false === strpos($big_pic_src, '#')) { $picInfo = @getimagesize($big_pic_src); $width = $picInfo[0]; $height = $picInfo[1]; } else { $picInfo = explode('#', $big_pic_src); $big_pic_src = $picInfo[0]; $width = $picInfo[1]; $height = $picInfo[2]; } $tmp_pic_list[$pic_k]['pic_src'] = $big_pic_src; $tmp_pic_list[$pic_k]['width'] = $width; $tmp_pic_list[$pic_k]['height'] = $height; } $pinlun['pic_list'] = $tmp_pic_list; } $xing_str = ''; for($tmp_i=1;$tmp_i<=$pinlun['pro_fen'];$tmp_i++){ $xing_str.=''; } for($tmp_i=$pinlun['pro_fen']+1;$tmp_i<=5;$tmp_i++){ $xing_str.=''; } $pinlun['fen_str'] = $xing_str; // 初級評論的商家回複 $sql = 'select * from user_pro_pinglun_reply where user_id='.$USERID.' and pinglun_id='.$pinlun['id']; $reply_info = $DB_Product->get_row($sql); $pinlun['reply_info'] = ($reply_info) ? $reply_info['content'] : ''; $pinlun['tmp_time'] = date('Y-m-d',strtotime($pinlun['input_time'])); // 追(zhuī)加評論 $pinlun['add_review'] = ''; if ($used_review_add == 2){ $pro_add_review_args = array('table' => 'user_pro_pinglun s', 'field' => 'id', 'where' => "s.pro_id = '".$pinlun['pro_id']."' and s.order_id='".$pinlun['order_id']."' and s.param_id='".$pinlun['param_id']."' and is_add!=0", 'start' => 0, 'pageSize' => 1, 'orderBy' => array('s.id'=>'desc') ); $pro_add_review_info = Model_Order::getRow($pro_add_review_args); if ($pro_add_review_info && $pro_add_review_info['id']){ $pro_add_review_info['tmp_time'] = date('Y-m-d',strtotime($pro_add_review_info['input_time'])); if ($pro_add_review_info['pic']){ $pic_add_str .= '
'; $sql = 'select pic from wap_bbs_theme_image where user_id='.$USERID.' and is_del=0 and id in('.$pro_add_review_info['pic'].')'; $pic_list = $DB_Ev123->get_results($sql); foreach ($pic_list as $pic_k=>$p_v){ $tmp_pic_src = str_replace('/wap_bbs_theme/640_3000/', '/wap_bbs_theme/200_100/', $p_v['pic']); $big_pic_src = $p_v['pic']; if (false === strpos($big_pic_src, '#')) { $picInfo = @getimagesize($big_pic_src); $width = $picInfo[0]; $height = $picInfo[1]; } else { $picInfo = explode('#', $big_pic_src); $big_pic_src = $picInfo[0]; $width = $picInfo[1]; $height = $picInfo[2]; } $tmp_pic_arr[$pic_k]['pic_src'] = $big_pic_src; $tmp_pic_arr[$pic_k]['width'] = $width; $tmp_pic_arr[$pic_k]['height'] = $height; } $pro_add_review_info['pic_list'] = $tmp_pic_arr; } $sql = 'select * from user_pro_pinglun_reply where user_id='.$USERID.' and pinglun_id='.$pro_add_review_info['id']; $reply_info = $DB_Product->get_row($sql); $pro_add_review_info['reply_info'] = ($reply_info) ? $reply_info['content'] : ''; $pinlun['add_review']=$pro_add_review_info; } } } $average=round($fen_count/$pin_count, 1); if ($average) { if ($average==0) { $fen_class='c-value-0'; } elseif ($average<1) { $fen_class='c-value-0d5'; } elseif ($average==1) { $fen_class='c-value-1'; } elseif ($average<2) { $fen_class='c-value-1d5'; } elseif ($average==2) { $fen_class='c-value-2'; } elseif ($average<3) { $fen_class='c-value-2d5'; } elseif ($average==3) { $fen_class='c-value-3'; } elseif ($average<4) { $fen_class='c-value-3d5'; } elseif ($average==4) { $fen_class='c-value-4'; } elseif ($average<5) { $fen_class='c-value-4d5'; } elseif ($average==5) { $fen_class='c-value-5'; } else { $fen_class='c-value-0'; } $bfb=($average/5)*100; } } } } } //參數設置 if (!$user_param) { if (defined('PARENT_CHANNEL_ID')) { $tmpChannelWhere = 'OR channel_id='.$channel_id; } $sql="select id from product_param where (user_id=".$user_id. $tmpUserIdWhere .") and (channel_id=".$channel_id. $tmpChannelWhere .") and is_del=0 limit 1"; $is_used_param=$DB_Product->get_var($sql); if (!$is_used_param) { if ($pro_arr['prounitprice']==0) { $show_danjia = 1; } } }if ($show_zuixiao==1) { if ($pro_arr['prosmallnum']) { $total = $pro_arr['prounitprice'] * $pro_arr['prosmallnum']; } else { $total = $pro_arr['prounitprice']; } } else { $total = $pro_arr['prounitprice']; }if ($user_param2 && $show_black==1) { $show_guige = 1; } else { $show_guige = 0; } /** * 產品圖冊 */ Model_ProAlbum::$pId = $id; $albumList = Model_ProAlbum::getAlbumList();if ($albumList) { foreach ($albumList as $k => $v) { $v->pic = Model_ProAlbum::getAlbumPicInfo('pic', "album_id={$v->id}"); if ($v->pic) { $albumList[$k]->pic = Job_Pic::format( [ 'type' => 2, 'pic' => $v->pic, 'width' => 200, 'height' => 200, 'field' => 'showPic', ] ); } else { $albumList[$k]->pic = 'https://img.ev123.com/pic/nopic/200_200.jpg'; } $albumList[$k]->cnt = Model_ProAlbum::getAlbumPicList('id', "album_id={$v->id}", 1); } $smarty->assign('albumList', $albumList); } /** * 產品最終頁關聯文章列表(biǎo) */ Model_ProDoc::$pId = $id; $docTagList = Model_ProDoc::getClassList( array( 'id' => 'id', 'name' => 'name', ) ); $smarty->assign('docTagList', $docTagList);/** * 關聯論壇列表 */ if ($pro_arr['open_bbs'] == 2) { $bbsChannelId = Model_Channel::getNewChannelInfo('id', 'type=7'); if ($bbsChannelId) { $forumsInfo = Model_Bbs::getForumsInfo( array( 'id' => 'id', 'name' => 'name', ), "pro_id={$id} && channel_id={$channel_id}" ); if ($forumsInfo) { $forumsInfo->bbsChannelId = $bbsChannelId; $threadList = Model_Bbs::getForumThreadsInfo( array( 'forum_id' => $forumsInfo->id, 'start' => 0, 'pageSize' => 10, ) ); if ($threadList) { foreach ($threadList as $k => $v) { $threadList[$k]->re_num = Model_Bbs::getCurrentRebookCount($v->id); $bbsReplyInfo = Model_Bbs::getLastRebookInfo( $v->id, array( 'user_id' => 'user_id', 'input_time' => 'input_time', ) ); if ($bbsReplyInfo) { $bbsReplyUserInfo = Model_User::getUserUserInfo($bbsReplyInfo->user_id); $threadList[$k]->date = substr($bbsReplyInfo->input_time, 0, 16); } else { $bbsReplyUserInfo = Model_User::getUserUserInfo($v->user_user_id); $threadList[$k]->date = substr($v->input_time, 0, 16); } if ($bbsReplyUserInfo) { $threadList[$k]->replyUsername = $bbsReplyUserInfo['nick_name'] ? $bbsReplyUserInfo['nick_name'] : ($bbsReplyUserInfo['qq_api'] ? 'QQ用戶' : $bbsReplyUserInfo['user_name']); } } } $smarty->assign('forumsInfo', $forumsInfo); $smarty->assign('threadList', $threadList); } } }// 優惠/服務標簽 $productTagHtml = Model_Product::getPrductTagHtmlCode( $LA['E_fuwuchengnuo'], $pro_arr['service_label'], $pro_arr['discount_label'] );$productServerTagHtml = $productPreferentialTagHtml = ''; if ($productTagHtml) { if ($productTagHtml['server']) { $productServerTagHtml = $productTagHtml['server']; } if ($productTagHtml['preferential']) { $productPreferentialTagHtml = $productTagHtml['preferential']; } $smarty->assign('productServerTagHtml', $productServerTagHtml); $smarty->assign('productPreferentialTagHtml', $productPreferentialTagHtml); }$otherParam = ''; $extendInfo = Model_Product::getExtendInfo($id, $channel_id); if ($extendInfo) { $extendArr = Job_Product::tradeWayFormat(var_json_decode($extendInfo->sys_upfile)); }//獲取(qǔ)會員等級 if (defined('USER_USER_ID')) { $userInfo = Model_User::getUserUserInfo(USER_USER_ID, array('vip'=>'vip')); $userLevel = $userInfo['vip']; } else { $userLevel = 1; } if ($extendInfo->grade_ids) { $gradeArr = explode(',', $extendInfo->grade_ids); if (in_array($userLevel, $gradeArr)) { $attrSet['is_set'] = 1; $attrSet['unsee_attr'] = explode(',', $extendInfo->unsee_ids); } } else { $proAttrSet = Model_Product::getAttrSet(); $gradeArr = explode(',', $proAttrSet->grade_ids); if (in_array($userLevel, $gradeArr) && $proAttrSet->open_set) { $attrSet['is_set'] = 1; if ($proAttrSet->unsee_ids) { /*1價格,2評論,3銷量,4產品詳細,5購物車和立即(jí)購(gòu)買*/ $attrSet['unsee_attr'] = explode(',', $proAttrSet->unsee_ids); } } } //累(lèi)計銷量(liàng) if ($pro_arr['open_sales'] == 2 && !in_array(3, $attrSet['unsee_attr'])) { $otherParam .= "{$LA['E_leijixiaoliang']}{$pro_arr['sale_num']}"; }if ($used_review != 2 && !in_array(2, $attrSet['unsee_attr'])) { if (!$pin_count) { $pin_count = 0; } $otherParam .= "{$LA['E_leijipingjia']}{$pin_count}"; }// 送積分 if ($user_param) { foreach ($user_param as $v) { if ($v['system_type'] == 4) { $jifen = Model_Jifen::getDdSetVal( USER_ID, array( 'jifen_price' => 'jifen_price', 'xf_rename' => 'xf_rename', 'jifen_isopen'=> 'jifen_isopen', ) ); if ($jifen->jifen_isopen==1 && $pro_arr['is_send_jifen']) { if ($jifen->xf_rename) { $LA['E_leijisongjifen'] = $jifen->xf_rename; } if ($pro_arr['send_jifen_set']==1) { $jifenNum = Model_Product::getProductJifen($v['value'], $jifen->jifen_price); } elseif ($pro_arr['send_jifen_set']==2 && $pro_arr['send_jifen_num']>=0) { $jifenNum = $pro_arr['send_jifen_num']; } } break; } } }// 其他購買方式數組 $shopOtherTradingMethod = Model_Product::shopOtherTradingMethod($pro_arr); $shopOtherTradingMethodExtend = Model_Product::getExtendInfo($pro_arr['pid'], $pro_arr['channel_id']); $shopOtherTradingMethodExtendArr = Job_Product::tradeWayFormat(var_json_decode($shopOtherTradingMethodExtend->sys_upfile));if ($shopOtherTradingMethod) { $otherTradingMethodHtml = ''; if ($shopOtherTradingMethod) { $otherTradingMethodHtml = Model_Product::shopOtherTradingMethodHtmlCode($shopOtherTradingMethod, $shopOtherTradingMethodExtendArr); } $smarty->assign('otherTradingMethodHtml', $otherTradingMethodHtml); }if ($pro_arr['is_trade_price'] && $show_button) { // 批發模式(shì) $pro_arr['prosmallnum'] = $pro_arr['trade_price_init_num'] ? $pro_arr['trade_price_init_num'] : 1; $con_guige_table = Model_GuiGe::get_dynamic_id_table(USER_ID); $guigeInfo = Model_GuiGe::get_pro_guige($id, $con_guige_table, array(),array('guige_id', 'desc')); $combination_sn_arr = Job_GuiGe::combination_sn_arr($guigeInfo, $channel_id); if ($combination_sn_arr) { $tmp_sn_id = ''; foreach ($combination_sn_arr as $key => $val) { $last_guige_arr[$val['sn_id']] = array_pop(explode('#', $val['value'])); $tmp_sn_arr = explode('|', $val['val_sn']); foreach ($tmp_sn_arr as $k => $v) { $tmp_val_arr = explode(':', $v); $tmp_guige_arr[$tmp_val_arr[0]][] = $tmp_val_arr[1]; } } if ($tmp_guige_arr) { $tmp_param_arr = array(); $guige_id_str = ''; foreach ($tmp_guige_arr as $key => $val) { $guige_id_str .= $key.','; $tmp_param_arr[$key] = implode(',' ,array_unique($val)); } $guige_id_str = rtrim($guige_id_str, ','); } if ($guige_id_str) { $con_guige_table = Model_GuiGe::get_con_guige_table(USER_ID); $guige_info = Model_GuiGe::get_guige_param($con_guige_table, '', array('order_sort'=>'order_sort', 'id'=>'id', 'name'=>'name'), 'id in ('.$guige_id_str.')', array('order_sort','desc'), array(0, 100)); } if ($guige_info) { $con_val_table = Model_GuiGe::get_con_val_table(USER_ID); for ($i=0; $i < count($guige_info); $i++) { if ($tmp_param_arr[$guige_info[$i]->id]) { //查(chá)詢出參數的名稱 $tmp_val = Model_GuiGe::get_guige_val($con_val_table, '', array('id'=>'id','name'=>'name'), 'id in ('.$tmp_param_arr[$guige_info[$i]->id].')', array(), array(0, 200)); $final_guige_arr[] = array('id'=>$guige_info[$i]->id, 'name'=>$guige_info[$i]->name, 'val'=>$tmp_val); } } } if ($final_guige_arr) { $final_num = count($final_guige_arr); $select_val_id = ''; foreach ($final_guige_arr as $k => $v) { if ($k+1 < $final_num) { foreach ($v['val'] as $k1 => $v1) { if ($k1 === 0) { $select_val_id .= $v['id'].':'.$v1->id.'|'; } } } elseif ($k+1 == $final_num) { $last_param_id = ''; if ($v['val']) { foreach ($v['val'] as $k6 => $v6) { $last_param_id .= $v6->id.','; } } } } $select_val_id = rtrim($select_val_id, '|'); $last_param_id = rtrim($last_param_id, ','); } $guigeNumCount = 4; $wholesaleParam['tableWidth'] = 110 * $guigeNumCount; } else { $pro_arr['isBuy'] = 1; if ($pro_arr['propurveynum'] < 1 || $pro_arr['propurveynum'] < $pro_arr['prosmallnum']) { $pro_arr['isBuy'] = 0; $pro_arr['initPayPrice'] = 0; } else { $pro_arr['initPayPrice'] = $pro_arr['trade_price1'] * $pro_arr['prosmallnum']; } } $smarty->assign('combination_sn_arr', $combination_sn_arr); $smarty->assign('wholesaleParam', $wholesaleParam); $pro_arr['showNumHtml1'] = "{$pro_arr['trade_price_init_num']}套起(qǐ)批"; $pro_arr['showNumHtml2'] = ($pro_arr['trade_price_num1'] + 1) .'-'. $pro_arr['trade_price_num2'] .'件'; $pro_arr['showNumHtml3'] = '≥'. ($pro_arr['trade_price_num2'] + 1) .'件'; }if ($pro_arr['is_trade_price']) { $pro_arr['proname'] = "【批發】{$pro_arr['proname']}"; } else { if ($pro_arr['is_clearance']==1) { $pro_arr['proname'] = "【清倉】{$pro_arr['proname']}"; } } //擴展表信息 $extend_info = Model_Product::getExtendInfo($id,$channel_id); if ($extend_info->is_overseas) { $pro_arr['proname'] = '【跨境】'.$pro_arr['proname']; }$info_arr[$k]['prounit'] = Job_Product::priceUnit($pro_arr['prounit']); $shareCode = Model_Public::shareCode(); $show_zuixiao = 1; // 最小定量 $proType = Model_Product::getProductType($id);//$proType 沒規格1,有規格2 $isQRCode = (($proType == 1 || $proType == 2) && SHOPPING_CART == 2) ? 1 : 0;if ($isQRCode) { $isWapPay = Model_Pay::pay_check(USER_ID, 1); $isQRCode = $isWapPay ? 1 : 0; } //顯(xiǎn)示二維碼 if ($isQRCode) {//開啟在線支付,支付方式(shì)有購物車 $wapLink = 'http://'. WAP_DOMAIN . Model_Channel::getWapDetailLink(10, $channel_id, $id); $QRImages = "/qrcode/create_code.php?url={$wapLink}"; $wapPriceInfo = Model_Product::getProPrice($id); $wapPriceHtml = ''; if ($wapPriceInfo['is_preferentialce'] && ($proType == 1)) { $wapPriceHtml = "
手機專享: ¥{$wapPriceInfo['price']}
"; } }// 獲取會員商品折扣(kòu) $hasTimeBuy = false; if ($timeBuyProInfo->set_timebuy || $timeBuyProInfo->is_state == 1) { if ($timeBuyProInfo->start_time > TIME_STR || $timeBuyProInfo->end_time < TIME_STR){ $hasTimeBuy = false; }else{ $hasTimeBuy = true; } }$pro_arr['actPrice'] = $pro_arr['price']; if (!$pro_arr['is_trade_price'] && !$clearanceInfo && !$hasTimeBuy){ $userProInfo = Model_UserProduct::getUserProductByPid($id); if ($userProInfo) { $level_arr = $userProInfo['level_arr']; $currentRebate = current($userProInfo['rebate']); $user_level = $userProInfo['user_level']; $currentLevelRabate = array(); if ($userProInfo['rebate_type'] == 1){ $rebate_price = $currentRebate[$user_level]['rebate_price']; $currentLevelRabate['rebateNum'] = 0; $currentLevelRabate['level_name'] = $level_arr[$user_level]['grade_name']; $currentLevelRabate['rebatePrice'] = $rebate_price; }else{ $rebate = $currentRebate[$user_level]['rebate']; $currentLevelRabate['rebateNum'] = $rebate; $currentLevelRabate['level_name'] = $level_arr[$user_level]['grade_name']; $currentLevelRabate['rebatePrice'] = ($rebate >0.00 && $rebate < 10.00) ? sprintf("%.2f",($rebate/10) * $pro_arr['prounitprice']) : $pro_arr['prounitprice']; } foreach ($currentRebate as $level=>$rebate){ if ($rebate['rebate'] <= 0.00 || $rebate['rebate'] >= 10.00){ unset($currentRebate[$level]); continue; } $currentRebate[$level]['rebatePrice'] = ($userProInfo['rebate_type']) ? $currentRebate[$level]['rebate_price'] : sprintf("%.2f",($rebate['rebate']/10) * $pro_arr['prounitprice']); } } // 如果產品沒有規格 if ($userProInfo && empty($currentRebate[$user_level]['pro_dynamic_id'])) { $total = $currentLevelRabate['rebatePrice']; $pro_arr['actPrice'] = $currentLevelRabate['rebatePrice']; if ($jifen->jifen_isopen==1 && $pro_arr['is_send_jifen']) { if ($jifen->xf_rename) { $LA['E_leijisongjifen'] = $jifen->xf_rename; } if ($pro_arr['send_jifen_set']==1) { $jifenNum = Model_Product::getProductJifen($total, $jifen->jifen_price); } elseif ($pro_arr['send_jifen_set']==2 && $pro_arr['send_jifen_num']>=0) { $jifenNum = $pro_arr['send_jifen_num']; } } } }if ($jifenNum) { $otherParam .= "{$LA['E_leijisongjifen']}$jifenNum"; $otherParam .= ''; }if ($otherParam) { $otherParamHtml .= << $otherParam
EOT; $smarty->assign('otherParamHtml', $otherParamHtml); }//收藏 $collectCurClass = 'no-collect'; $collectName = '收藏'; if (defined('USER_USER_ID')) { $isCollege = Model_Product::getProIsCollection($channel_id, $pro_arr['pid'], USER_ID, USER_USER_ID); $collectCurClass = $isCollege ? 'yes-collect' : 'no-collect'; $collectName = $isCollege ? '已收藏' : '收藏'; } $userPro_desc_show = Model_UserProduct::userProductPic(array("desc_show"=>"desc_show"));$showArr = array(); if (in_array(1, $attrSet['unsee_attr'])) { $showArr['price'] = 1; } if (in_array(2, $attrSet['unsee_attr'])) { $showArr['pinglun'] = 1; } if (in_array(3, $attrSet['unsee_attr'])) { $showArr['sale_num'] = 1; } if (in_array(4, $attrSet['unsee_attr'])) { $showArr['content'] = 1; } if (in_array(5, $attrSet['unsee_attr'])) { $showArr['buy'] = 1; }$smarty->assign('showArr', $showArr); $smarty->assign('extend_info', $extend_info); $smarty->assign('select_val_id', $select_val_id); $smarty->assign('last_param_id', $last_param_id); $smarty->assign('final_guige_arr', $final_guige_arr); $smarty->assign('final_num', $final_num); $smarty->assign('collectCurClass', $collectCurClass); $smarty->assign('collectName', $collectName); $smarty->assign('userPro_desc_show', $userPro_desc_show); $smarty->assign('guige_sort', $guige_sort); $smarty->assign('guige_str', $guige_str); $smarty->assign('guige_info', $guige_info); $smarty->assign('rebate', $currentRebate); $smarty->assign('rebate_type', $userProInfo['rebate_type']); $smarty->assign('level_arr', $level_arr); $smarty->assign('user_level', $user_level); $smarty->assign('zz_userid', $userProInfo['zz_userid']); $smarty->assign('currentLevelRabate', $currentLevelRabate); $smarty->assign('big_id_arr', $big_id_arr); $smarty->assign('sub_id_arr', $sub_id_arr); $smarty->assign('sub_sub_id_arr', $sub_sub_id_arr); $smarty->assign('isQRCode', $isQRCode); $smarty->assign('QRImages', $QRImages); $smarty->assign('wapPriceHtml', $wapPriceHtml); $smarty->assign('shareCode', $shareCode); $smarty->assign('timeBuyProInfo', $timeBuyProInfo); $smarty->assign('clearanceInfo', $clearanceInfo); $smarty->assign('total', $total); $smarty->assign('param_checked_ids', $param_checked_ids); $smarty->assign('show_zuixiao', $show_zuixiao); $smarty->assign('show_kucun', $show_kucun); $smarty->assign('show_danjia', $show_danjia); $smarty->assign('show_black', $show_black); $smarty->assign('sub_name_arr', $sub_name_arr); $smarty->assign('id', $id); $smarty->assign('buy_num', $buy_num); $smarty->assign('use_buy_num', $use_buy_num); $smarty->assign('is_used_param', $is_used_param); $smarty->assign('fen_class', $fen_class); $smarty->assign('used_review', $used_review); $smarty->assign('pin_count', (int)$pin_count); $smarty->assign('pinlun_arr', $pinlun_arr); $smarty->assign('bfb', $bfb); $smarty->assign('average', $average); $smarty->assign('user_param2', $user_param2); $smarty->assign('user_param', $user_param); $smarty->assign('proname_arr', $proname_arr); $smarty->assign('proname_all', $proname_all); $smarty->assign('css_filename', $css_filename); $smarty->assign("system_arr", $system_arr); $smarty->assign('channel_info_arr', $channel_info); $smarty->assign('channel_info_arr2', $channel_info11); $smarty->assign('bottom_info_arr', $bottom_info_arr); $smarty->assign('bottom_item_arr', $bottom_item_arr); $smarty->assign('pro_arr', $pro_arr); $smarty->assign('channel_id', $channel_id); $smarty->assign('sub_class_arr', $sub_class_arr); $smarty->assign('sub_num_arr', $sub_num_arr); $smarty->assign('name', $name); $smarty->assign('big_name', $big_name); $smarty->assign('sub_name', $sub_name); $smarty->assign('sub_sub_name', $sub_sub_name); $smarty->assign('focus_pic_str', $focus_pic_str); $smarty->assign('new_focus_pic_str', $new_focus_pic_str); $smarty->assign('focus_name_str', $focus_name_str); $smarty->assign('focus_url_str', $focus_url_str); $smarty->assign('pro_info_arr', $pro_info_arr); $smarty->assign('info_cnt', $info_cnt); $smarty->assign('channel_info_arr', $channel_info); $smarty->assign('maxImg', $maxImg); $smarty->assign('big_id', $big_id); $smarty->assign('sub_id', $sub_id); $smarty->assign('sub_sub_id', $sub_sub_id); $smarty->assign('user_name', $user_name); $smarty->assign('guest_chan_id', $guest_chan_id); $smarty->assign('line_jobs', $line_jobs); $smarty->assign('ad_type1', $ad_type1); $smarty->assign('img_num', $img_num); $smarty->assign('img_width', $img_width); $smarty->assign('big_class_arr', $big_class_arr); $smarty->assign('sub_class_arr2', $sub_class_arr2); $smarty->assign('sub_sub_class_arr', $sub_sub_class_arr); $smarty->assign('ad_arr', $ad_arr); $smarty->assign('ch_info', $ch_info); $smarty->assign('tel', $tel); $smarty->assign('duiying_pinpai', $duiying_pinpai); $smarty->assign('is_store_send', $is_store_send); $smarty->assign('store_link', $store_link); $smarty->assign('show_button', $show_button); $smarty->assign('show_guige', $show_guige); $smarty->display($dec['detail_'.$model_id].'pro_detail.tpl');