=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)';
$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 .= <<
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');