<?php
/************************
VIP自定义模板产品列表页
 ************************/


use SelfColumnModel\Website\EvUserChannelColumnModel;
use SelfVendor\SelfReturn;
use SelfVendor\SelfSpecial;
use SelfVendor\SelfString;
use SelfVendor\WebsiteCh\WebsiteChUrlFn;

require_once('./setting.php');
require_once(SYSTEM_ROOT.'include/smarty_setting.php');
require_once(SYSTEM_ROOT.'include/public.php');

if (!$ch_info) {
    SelfReturn::redirect(['code' => 8000778]);
}
if ($ch_info['type'] != EvUserChannelColumnModel::TYPE_10) {
    SelfReturn::redirect(['code' => 8000779]);
}

if (Job_Wap::check_wap() && $user_tag->used_mobile && $user_tag->web_show_mobile) {
    $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    $url = str_replace('/products', '/wap_pro', $url);
    $url = str_replace('/pro_', '/wpro_', $url);
    header('Location: '.$url);
    exit();
}

if ($user_tag->is_tj == 1) {
    if (SelfSpecial::rule102(USER_ID)) {
        $tmpBigId = isset($_REQUEST['big_id']) ? (int)$_REQUEST['big_id'] : 0;

        $urlParamInfo = [];
        if ($tmpBigId) {
            $tmpBigName = Model_Product::getClassInfo($tmpBigId, 'classname');

            $urlParamInfo = [
                'search_ch_id' => $channel_id,
                'big_abbr'     => SelfString::getFirstCharPinYin($tmpBigName, true),
                'big_id'       => $tmpBigId,
            ];
        }

        $tmpUrl = WebsiteChUrlFn::getUrl([
            'type'         => WebsiteChUrlFn::CH_TYPE_1015_TYPE_1,
            'username'     => USER_NAME,
            'chType'       => EvUserChannelColumnModel::TYPE_1015,
            'urlParamInfo' => $urlParamInfo,
        ]);

        SelfReturn::redirect([
            'type' => SelfReturn::REDIRECT_TYPE_4,
            'url'  => $tmpUrl,
        ]);
    }

    $jobWebsiteRule9   = 0;
    $jobWebsiteRule9V1 = 0;
    $jobWebsiteRule9V2 = 0;
    if (ENVIRONMENT == 'development') {
        if (in_array($channel_id, [21735559, 22751659, 18579462,])) {
            $jobWebsiteRule9 = Job_Website::rule9(USER_ID);
        }
    } else {
        if (in_array($channel_id, [19366215, 19366216, 19366217, 19366218, 19366222,])) {
            $jobWebsiteRule9   = Job_Website::rule9(USER_ID);
            $jobWebsiteRule9V1 = 1;
        } elseif (in_array($channel_id, [19366211, 19366214, 19366212, 19366213,])) {
            $jobWebsiteRule9   = Job_Website::rule9(USER_ID);
            $jobWebsiteRule9V2 = 1;
        }
    }

    $smarty->assign('jobWebsiteRule9', $jobWebsiteRule9);
    $smarty->assign('jobWebsiteRule9V1', $jobWebsiteRule9V1);
    $smarty->assign('jobWebsiteRule9V2', $jobWebsiteRule9V2);
    $smarty->display('tjNew/index.tpl');
    exit();
}

//国电华瑞特殊处理
if ($user_name == 'bjgrhd') {
    require_once(UPPER_ROOT.'/include/page_str1.php');
} else {
    require_once(UPPER_ROOT.'/include/page_str.php');
}
$page       = $_REQUEST['page']           ? trim($_REQUEST['page']):1;
$key_word   = $_REQUEST['keyWord']      ? trim($_REQUEST['keyWord']):'';
$channel_id = $_REQUEST['channel_id'] ? (int)$_REQUEST['channel_id']:0;//频道id
$big_id     = $_REQUEST['big_id']         ? (int)$_REQUEST['big_id']:0;//大类id
$sub_id     = $_REQUEST['sub_id']         ? (int)$_REQUEST['sub_id']:0;//小类id
$sub_sub_id = $_REQUEST['sub_sub_id']     ? (int)$_REQUEST['sub_sub_id']:0;//三级类
$manu_id    = $_REQUEST['manu_id']    ? (int)$_REQUEST['manu_id']:0;//品牌id
$sp         = $_REQUEST['sp']                 ? (int)$_REQUEST['sp']:'';//查询小价钱
$bp         = $_REQUEST['bp']                 ? (int)$_REQUEST['bp']:'';//查询大价钱
$o          = $_REQUEST['o']                  ? (int)$_REQUEST['o']:1;//排序
$s          = $_REQUEST['s']                  ? (int)$_REQUEST['s']:0;//产品特殊状态
$r          = $_REQUEST['r']                  ? trim($_REQUEST['r']):'';//价格区间
$full_cut_id  = $_REQUEST['full_cut_id']  ? (int)$_REQUEST['full_cut_id']:0;//满减
$pagerows   = (int)$PAGE_SIZES            ?:12;
//价格区间
if ($r) {
    $price_range=explode('*', $r);
}

//价格段搜索查询
if ($sp || $bp) {
    $price_range=array();
    $price_range[0]=format_price_new($sp);
    $price_range[1]=format_price_new($bp);
    $r='';
}
if (defined('PARENT_CHANNEL_ID')) {
    $parentChannelWhere = ' OR channel_id='.PARENT_CHANNEL_ID;
}
//品牌列表
if ($channel_id) {
    if ($big_id) {
        $sql="select manu_id from proinfo
              where (channel_id=".$channel_id.$parentChannelWhere.") and bigclassid=".$big_id." and manu_id!=0 and is_del=0
              group by manu_id ";
        $tmp_manu_arr=$DB_Product->get_results($sql);
        if ($tmp_manu_arr) {
            $tmp_manu_str='';
            foreach ($tmp_manu_arr as $tmp_manu) {
                $tmp_manu_str.=$tmp_manu['manu_id'].',';
            }
            $tmp_manu_str = substr($tmp_manu_str, 0, -1);
            $tmp_sql3 =" and (sub_id=".$big_id." or id in(".$tmp_manu_str.") )";
        } else {
            $tmp_sql3 =" and sub_id=".$big_id." ";
        }
    } else {
        $tmp_sql3 ="  and sub_id=0";
    }
    $sql = "select id,name from ev_user_manu
            where (userid=".$user_id. $parentUserWhere.")  AND is_del=0
                        AND (channel_id=".$channel_id.$parentChannelWhere.')'.$tmp_sql3."
            order by order_sort desc,id desc";
    $manu_info_arr=$DB_Ev123->get_results($sql);
    //echo '<!--'.$sql.'-->';
}

//取品牌名称
if ($manu_id) {
    $sql = "select * from ev_user_manu where id=".$manu_id." and userid=".$user_id;
    $manu_info = $DB_Ev123->get_row($sql);
    $tmp_sql2.=" and manu_id=".$manu_id;
}


if ($model_id==27) {
    if ($manu_id) {
        //$channel_id = 0;
    }
    require_once(SYSTEM_ROOT.'dom/other27_pro.php');
} else {
    if (!$channel_id && !$key_word) {
        echo '<script lanaguage="javascript">location.href="/vip_'.$user_name.'.html";</script>';
    }
    if ($manu_id && !$big_id) {
        $sql="select sub_id from ev_user_manu where id=".$manu_id;
        $big_id=$DB_Ev123->get_var($sql);
    }
}

//得到频道类型
if ($channel_id) {
    $info_arr = get_chan_name(' where id='.$channel_id);
    $type = $info_arr['type'];
    $name = $info_arr['name'];
    $name_id =$info_arr['id'];
    if ($big_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);
    }
} else {
    $name = iconv("UTF-8", "GB2312", $search_goods);
}

//获得类别信息
$sub_tmp_arr   = get_class_info($user_id, $channel_id);
$sub_class_arr = array();
$sub_name_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++;
    }
}
//类别----新写
if ($channel_id) {
    $class_arr=get_pro_class($user_id, $channel_id);
    $big_class_arr=$class_arr[0];
    if ($big_class_arr) {
        foreach ($big_class_arr as $k=>$v) {
            if ($k == $big_id) {
                $big_class_name = $v['classname'];
            }
        }
    }
    $sub_class_arr2=$class_arr[1];
    if ($sub_class_arr2) {
        foreach ($sub_class_arr2 as $key => $val) {
            if ($val[$sub_id]) {
                $sub_class_name = $val[$sub_id]['classname'];
            }
        }
    }
    $sub_sub_class_arr = $class_arr[2];
    $tmp_sql2 .= " and p.channel_id=".$channel_id;
}

if (defined('USER_USER_ID')) {
    $userInfo = Model_User::getUserUserInfo(USER_USER_ID, array('vip'=>'vip'));
    $userLevel = $userInfo['vip'];
} else {
    $userLevel = 1;
}

//频道页未指定类别和其他条件时，按该频道下的大类分栏展示！
if (!$big_id && !$sub_id && !$manu_id && !$price_range && !$s && $PAGE_TYPE==1 && $SCEEN_TYPE==2 && $dom_tmp_id !== 25 && $dom_tmp_id != 12 && $dom_tmp_id != 26 && !$key_word && !$full_cut_id) {
    $big_pro_info=array();
    $tmp_num=($dom_tmp_id == 19)?5:$tmp_num=4;
    if ($big_class_arr) {
        foreach ($big_class_arr as $key => $big_info) {
            $tmp_arr=get_pro_info($user_id, $key, 0, $channel_id, $tmp_num);
            $tmp_arr2=get_new_pro_info($tmp_arr);
            $big_pro_info[$key]['list']=$tmp_arr2[0];
            $big_pro_info[$key]['name']=$big_info['classname'];
            $big_pro_info[$key]['link']=$big_info['link'];
        }
    }
    $list_style=1;//列表展示模式
} else {
    //价格范围
    $price_info_arr = array();
    $tmp_sql = "and class_id=".(int)$big_id;
    $sql = "select id,max_price,min_price from user_pro_price_range
            where user_id=".$user_id." and channel_id=".$channel_id." ".$tmp_sql."
            order by order_sort desc, id asc ";
    $price_arr = $DB_Product->get_results($sql, 'O');
    if (!$price_arr && $big_id) {
        $sql = "select id,max_price,min_price from user_pro_price_range
                where user_id=".$user_id." and channel_id=".$channel_id." and class_id=0
                order by order_sort desc, id asc ";
        $price_arr = $DB_Product->get_results($sql, 'O');
    }
    //价格处理
    if ($price_arr) {
        foreach ($price_arr as $p => $price) {
            $price->min_price=format_price_new($price->min_price);
            $price->max_price=format_price_new($price->max_price);
            if ($price->max_price == 0) {
                $price_info_arr[$p]["price"]=$price->min_price."以上";
            } else {
                $price_info_arr[$p]["price"]=$price->min_price."-".$price->max_price;
            }
            $price_info_arr[$p]["tag"]=$price->min_price.'*'.$price->max_price;
        }
    }
    //判断是为子网站
    if (defined('PARENT_USER_ID')) {
        $tmpUserWhere = ' OR p.userid='.PARENT_USER_ID;
    }
    //组合SQL
    $tmp_sql2=' 1 ';

    if ($manu_id) {
        $tmp_sql2.=" && manu_id=".$manu_id;
    }
    if ($price_range) {
        $tmp_sql2.=" && prounitprice>=".$price_range[0];
        if ($price_range[1] > 0) {
            $tmp_sql2.=" && prounitprice<".$price_range[1];
        }
    }
    if ($s) {
        $tmp_sql2.=" && status=".$s;
    }
    if ($full_cut_id) {
        $tmp_sql2.=" && full_cut_id=".$full_cut_id;
    }
    if ($key_word) {
        $tmp_sql2.=" && (proname like BINARY  '%".$key_word."%' or keywords like BINARY '%".$key_word."%')";

        // 获取当前网站所有产品频道id，包括从主站同步产品频道
        $channelList = Model_Channel::getNewChannelList(
            array(
                'id'        => 'id',
                'parent_id' => 'parent_id',
            ),
            'type=10'
        );

        $channelIds = array();
        if ($channelList) {
            foreach ($channelList as $k => $v) {
                $channelIds[] = ($v->parent_id && defined('PARENT_USER_ID')) ? $v->parent_id : $v->id;
            }

            $channelIds = implode(',', $channelIds);

            Model_Product::$channel_id = $channelIds;
        }
    } else {
        Model_Product::$channel_id = $channel_id;
    }

    //分数显示数量
    if ($model_id==31) {
        $pagerows = 60;
    }
    if ($model_id==32) {
        $pagerows = 16;
    }
    if ($model_id==214) {//千琦科贸
        $pagerows = 6;
    }
    if ($model_id==213) {
        $pagerows = 12;
    }
    if ($model_id==302) {
        $pagerows = 12;
    }
    if ($model_id==314) {
        $pagerows = 10;
    }
    if ($dom_tmp_id == 19) {
        $pagerows = 25;
    }


    //公司产品
    $pro_info_arr = array();

    if ($big_id) {
        if ($big_id) {
            $tmp_sql2 .= ' && c.big_id='. $big_id;
        }
        if ($sub_id) {
            $tmp_sql2 .= ' && c.sub_id='. $sub_id;
        }

        if ($sub_sub_id) {
            $tmp_sql2 .= ' && c.sub_sub_id='.$sub_sub_id;
        }
    }

    $count_num = Model_Product::getProList(
        1,
        array(),
        $tmp_sql2,
        array(),
        array(),
        1
    );

    $page_num=ceil($count_num/$pagerows);
    if ($count_num) {
        $order_sort = array('p.is_top desc,p.order_sort desc, p.pid', 'desc');
        if ($o ==2) {
            $order_sort[0] = 'p.hits desc,p.pid';
        } elseif ($o ==3) {
            $order_sort[0] = 'p.prounitprice+0 desc,p.pid';
        } elseif ($o ==4) {
            $order_sort[0] = 'p.prounitprice+0 asc,p.pid';
        }

        //分页显示
        if (!$page || 0 ==(int)$page) {
            $page   = 1;
            $offset = 0;
        } elseif ($page<=0) {
            $page   = 1;
            $offset = 0;
        } elseif ($page>$page_num) {
            $page = $page_num;
            $offset=($page-1)*$pagerows;
        } else {
            $offset=($page-1)*$pagerows;
        }
        if ($model_id==210) {
            require_once(SYSTEM_ROOT.'dom/other210_pro.php');
        } else {
            $info_list_arr = 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',
                    'full_cut_id'    => 'full_cut_id',
                ),
                $tmp_sql2,
                $order_sort,
                array($offset, $pagerows));
            $info_list_arr = Model_Public::newObjToArray($info_list_arr);
            //格式化产品显示数据
            $tmp_pro_info=get_new_pro_info($info_list_arr);
            $info_arr=$tmp_pro_info[0];
            foreach ($info_arr as $k => $v) {

                $proAttrSet = Model_Product::getAttrSet();
                $gradeArr = explode(',', $proAttrSet->grade_ids);
                if (in_array($userLevel, $gradeArr) && $proAttrSet->open_set) {
                    $info_arr[$k]['is_set'] = 1;
                    if ($proAttrSet->unsee_ids) {
                        /*1: 价格，2: 评论，3: 销量，4: 产品详细，5: 购物车和立即购买*/
                        $info_arr[$k]['unsee_attr'] = explode(',', $proAttrSet->unsee_ids);
                    }
                }


                $showArr = array();
                if (in_array(1, $info_arr[$k]['unsee_attr'])) $showArr['price'] = 1;
                if (in_array(2, $info_arr[$k]['unsee_attr'])) $showArr['pinglun'] = 1;
                if (in_array(3, $info_arr[$k]['unsee_attr'])) $showArr['sale_num'] = 1;
                if (in_array(4, $info_arr[$k]['unsee_attr'])) $showArr['content'] = 1;
                if (in_array(5, $info_arr[$k]['unsee_attr'])) $showArr['buy'] = 1;
                $info_arr[$k]['showArr'] = $showArr;
            }
            $big_pic_arr=$tmp_pro_info[1];
            $sml_pic_arr=$tmp_pro_info[2];

            $img_num = $i-1;
            $img_width = $img_num*90;
            if ($model_css) {
                if ($key_word || $manu_id || $price_range || $s || $o>1) {
                    $tmp_price='';
                    if ($price_range) {
                        $tmp_price=$price_range[0].'*'.$price_range[1];
                    }
                    $page_str = page_str8($count_num, $pagerows, $page, '/self_define/pro_list.php?username='.$user_name.'&keyWord='.$key_word.'&manu_id='.$manu_id.'&r='.$tmp_price.'&channel_id='.$channel_id.'&big_id='.$big_id.'&sub_id='.$sub_id.'&sub_sub_id='.$sub_sub_id.'&s='.$s.'&o='.$o.'&page=');
                } else {
                    $page_str = page_str8($count_num, $pagerows, $page, '/'.$user_name.'/products/'.$channel_id.'_'.$big_id.'_'.$sub_id.'_', '.html?sub_sub_id='.$sub_sub_id);
                }
            } else {
                if ($model_id==213) {
                    $page_str = page_str5($count_num, $pagerows, $page, '/'.$user_name.'/products/'.$channel_id.'_'.$big_id.'_'.$sub_id.'_', '.html?sub_sub_id='.$sub_sub_id);
                } elseif ($model_id==55 || $model_id==69 || $model_id==245 || $model_id==250 || $model_id==285 || $model_id>=302 ||  $is_define_temp) {
                    if ($key_word || $manu_id) {
                        $page_str = page_str6($count_num, $pagerows, $page, '/self_define/pro_list.php?username='.$user_name.'&keyWord='.$key_word.'&manu_id='.$manu_id.'&channel_id='.$channel_id.'&big_id='.$big_id.'&sub_id='.$sub_id.'&sub_sub_id='.$sub_sub_id.'&page=');
                    } else {
                        $page_str = page_str6($count_num, $pagerows, $page, '/'.$user_name.'/products/'.$channel_id.'_'.$big_id.'_'.$sub_id.'_', '.html?sub_sub_id='.$sub_sub_id);
                    }
                } else {
                    if ($key_word || $manu_id) {
                        $page_str = page_str2($count_num, $pagerows, $page, '/self_define/pro_list.php?username='.$user_name.'&keyWord='.$key_word.'&manu_id='.$manu_id.'&channel_id='.$channel_id.'&big_id='.$big_id.'&sub_id='.$sub_id.'&sub_sub_id='.$sub_sub_id.'&page=');
                    } else {
                        $page_str = page_str2($count_num, $pagerows, $page, '/'.$user_name.'/products/'.$channel_id.'_'.$big_id.'_'.$sub_id.'_', '.html?sub_sub_id='.$sub_sub_id);
                    }
                }
            }
            $pro_info_arr[0]=$info_arr;
            $pro_info_arr[1]=$page_str;
            $pro_info_arr[2]=$big_pic_arr;
            $pro_info_arr[3]=$sml_pic_arr;
            $pro_info_arr[4]=$count_num;
        }
    }
    if ($model_id==210) {
        $first_pro_arr=$pro_info_arr[0];
        $other_pro_arr=$pro_info_arr[1];
        $pro_pic_arr=$pro_info_arr[2];
        $smarty->assign('first_pro_arr', $first_pro_arr);
        $smarty->assign('other_pro_arr', $other_pro_arr);
        $smarty->assign('pro_pic_arr', $pro_pic_arr);
    } else {
        $info_arr=$pro_info_arr[0];
        $page_str=$pro_info_arr[1];
        $big_pic_arr=$pro_info_arr[2];
        $sml_pic_arr=$pro_info_arr[3];
        $count_num=$pro_info_arr[4];
    }

    $sel_id=0;
    if ($big_id) {
        $sel_id=$big_id;
    }
    if ($sub_id) {
        $sel_id=$sub_id;
    }
    if ($model_id==218) {
        require_once(SYSTEM_ROOT.'dom/other218_pro.php');
    }
    //是否为筛选模式
    $is_sx=0;
    if ($key_word || $manu_id || $price_range || $s || $o>1) {
        $is_sx=1;
    }
    $list_style=2;
}//end 未指定条件数据

//广告
$ad_arr=get_ad_info($user_id, $model_id, $channel_id, $sel_id);
if ($ad_arr) {
    foreach ($ad_arr as $key => $val) {
        $smarty->assign('ad_'.$key, $val);
    }
}
if ($info_arr) {
    foreach ($info_arr as $k => $v) {
        //扩展表信息
        $extend_info = Model_Product::getExtendInfo($v['pid'],$channel_id);
        $info_arr[$k]['prounit'] = Job_Product::priceUnit($v['prounit']);

        $tmpProParam = Model_Product::getGuigeInfo(
            array(
                'param_combination' => 'param_combination'
            ),
            'good_id='.$v['pid'].' && is_del=0'
        );
        $proType = Model_Product::getProductType($v['pid']);
        if (!$tmpProParam && SHOPPING_CART==2) {
            if ($proType == 5) {
                // 当前商品限时购信息
                $timeBuyProInfo = Model_TimeBuy::thisProductMessage($v['pid']);

                if ($timeBuyProInfo->is_buy) {
                    $info_arr[$k]['propurveynum'] = $timeBuyProInfo->max_buy; // 库存
                    $info_arr[$k]['prosmallnum']  = $timeBuyProInfo->smallnum; // 最少购买数量
                    $info_arr[$k]['market_price'] = $timeBuyProInfo->proPrice;
                    $info_arr[$k]['prounitprice'] = $timeBuyProInfo->price;
                }
            }
        }
        if ($proType == 10 || $proType == 11) {
            $v['clearanceInfo'] = Model_Clearance::getProductInfo($v['pid']);
            if ($v['clearanceInfo']->is_clearance) {
                $info_arr[$k]['prosmallnum']  = $v['clearanceInfo']->smallnum; // 最少购买数量
                $info_arr[$k]['market_price'] = $v['clearanceInfo']->proPrice;
                $info_arr[$k]['prounitprice'] = $v['clearanceInfo']->price;
            }
        }
        if ($v['full_cut_id']) {
            $fullCutInfo = Model_Product::getFullCutInfo($v['full_cut_id']);
            if ($fullCutInfo) {
                $info_arr[$k]['proname'] = "【满减】{$v['proname']}";
            }
        }
        if ($v['clearanceInfo']->is_clearance) {
            $info_arr[$k]['proname'] = "【清仓】【满减】{$v['proname']}";
        } else {
            if ($v['is_trade_price']) {
                $info_arr[$k]['proname'] = "【批发】{$v['proname']}";
            }
        }
        if($extend_info->is_overseas){
            $info_arr[$k]['proname'] = '【跨境】'.$info_arr[$k]['proname'];
        }

    }
}
$price_is_show = Model_Public::querySql("select id,is_show from productchannel.product_param where system_type=4 and user_id=".$USERID." and channel_id={$channel_id} and is_del=0","get_row","DB_Product");
$old_price_is_show = Model_Public::querySql("select id,is_show from productchannel.product_param where system_type=5 and user_id=".$USERID." and channel_id={$channel_id} and is_del=0","get_row","DB_Product");
$smarty->assign('big_class_name', $big_class_name);
$smarty->assign('sub_class_name', $sub_class_name);
$smarty->assign('list_style', $list_style);
$smarty->assign('big_pro_info', $big_pro_info);
$smarty->assign('is_sx', $is_sx);
$smarty->assign('system_arr', $system_arr);
$smarty->assign('channel_info_arr', $channel_info);
$smarty->assign('channel_info_arr2', $channel_info11);
$smarty->assign('sub_class_arr', $sub_class_arr);
$smarty->assign('price_is_show', $price_is_show['is_show']);
$smarty->assign('old_price_is_show', $old_price_is_show['is_show']);
$smarty->assign('info_arr', $info_arr);
$smarty->assign('page_str', $page_str);
$smarty->assign('page', $page);
$smarty->assign('sub_num_arr', $sub_num_arr);
$smarty->assign('name', $name);
$smarty->assign('name_id', $name_id);
$smarty->assign('bottom_info_arr', $bottom_info_arr);
$smarty->assign('bottom_item_arr', $bottom_item_arr);
$smarty->assign('channel_id', $channel_id);
$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('sub_name_arr', $sub_name_arr);
$smarty->assign('guest_chan_id', $guest_chan_id);
$smarty->assign('line_jobs', $line_jobs);
$smarty->assign('ad_type1', $ad_type1);
$smarty->assign('big_name', $big_name);
$smarty->assign('sub_name', $sub_name);
$smarty->assign('sub_sub_name', $sub_sub_name);
$smarty->assign('count_num', $count_num);
$smarty->assign('manu_id', $manu_id);
$smarty->assign('is_pro', 1);
$smarty->assign('big_pic_arr', $big_pic_arr);
$smarty->assign('sml_pic_arr', $sml_pic_arr);
$smarty->assign('img_num', $img_num);
$smarty->assign('img_width', $img_width);
$smarty->assign('ad_arr', $ad_arr);
$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('manu_info_arr', $manu_info_arr);
$smarty->assign('key_word', $key_word);
$smarty->assign('small_class_arr', $small_class_arr);
$smarty->assign('price_info_arr', $price_info_arr);
$smarty->assign('o', $o);
$smarty->assign('r', $r);
$smarty->assign('bp', $bp);
$smarty->assign('sp', $sp);
$smarty->assign('s', $s);
$smarty->assign('full_cut_id', $full_cut_id);

if ($key_word) {
    //用于搜索
    if ($model_info['not_2013_layout']) {
        $smarty->display('./own_product/10/pro_list.tpl');
    } else {
        $smarty->display('./own_product/15/pro_list.tpl');
    }
} else {
    $smarty->display($dec[$model_id].'pro_list.tpl');
}
