Ejemplo n.º 1
0
Archivo: index.php Proyecto: zwq/unpei
?>
">
                <label  class=" m_left24">商品品牌:</label>
                <?php 
//                $organID = Commonmodel::getOrganID();
//                $brandNames = PapBrand::model()->findAll("OrganID = $organID");
$brandNames = DealergoodsService::dealergetbrand();
$brandName = CHtml::listData($brandNames, 'BrandID', 'BrandName');
echo CHtml::dropDownList('BrandID', $_GET['BrandID'], $brandName, array('class' => 'select select2', 'empty' => '选择商品品牌'));
?>
	
            </p>
            <p class="m-top">
                <label>配件品类:</label>
                <input id="cpname-search" readonly="readonly" type="text" class=" input input3"  value="<?php 
echo DealergoodsService::StandCodegetcpname($_GET['StandCode'], 'Name');
?>
">

                <label  class=" m_left24">拼音代码:</label>
                <input name="Pinyin" type="text" class=" input input3" value="<?php 
echo str_replace('<<q>>', '/', $_GET['Pinyin']);
?>
">
                <label  class=" m_left24">配件档次:</label>

                <select class='select select2' name="PartsLevel">
                    <option value="">请选择配件档次</option>
                    <?php 
foreach (Yii::app()->getParams()->PartsLevel as $key => $value) {
    if ($key == $_GET['PartsLevel']) {
Ejemplo n.º 2
0
 public static function newgoodsxinfo($GoodsID)
 {
     $PartsLevel = array('A' => '原厂', 'B' => '高端品牌', 'C' => '经济实用', 'D' => '下线', 'E' => '拆车');
     $Goods = PapGoods::model()->findBypk($GoodsID);
     if ($Goods) {
         $arr = $Goods->attributes;
         $arr['Brand'] = self::idgetjpbrand($Goods->attributes['BrandID'], 'BrandName');
         //机构名称
         $arr['OrganName'] = self::getnamebyorganid($Goods->attributes['OrganID']);
         //获得配件档次名称
         $arr['PartsLevelName'] = $PartsLevel[$Goods->attributes['PartsLevel']];
         //获得标准名称
         $arr['StandCodeName'] = DealergoodsService::StandCodegetcpname($Goods->attributes['StandCode'], 'Name');
         //商品-OE号
         $oeno = PapGoodsOeRelation::model()->findAll('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         foreach ($oeno as $value) {
             $arr['oeno'][] = $value->attributes['OENO'];
         }
         $gcategory = MallService::getCategory($Goods->attributes['StandCode']);
         //            $version['gcategory'] = $gcategory->attributes;
         $redis['gcategory']['BigParts'] = $gcategory['BigPartsID'];
         $redis['gcategory']['SubParts'] = $gcategory['SubPartsID'];
         $redis['gcategory']['BigName'] = $gcategory['BigParts'];
         $redis['gcategory']['SubName'] = $gcategory['SubParts'];
         //商品-图片
         $img = PapGoodsImageRelation::model()->findAll('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         foreach ($img as $key => $value) {
             $arr['img'][$key]['ImageUrl'] = $value->attributes['ImageUrl'];
             $arr['img'][$key]['ImageName'] = $value->attributes['ImageName'];
             $arr['img'][$key]['BigImage'] = $value->attributes['BigImage'];
             $arr['img'][$key]['MallImage'] = $value->attributes['MallImage'];
         }
         //商品-属性
         $spec = PapGoodsSpec::model()->find('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         $arr['spec']['ValidityType'] = $spec->attributes['ValidityType'];
         $arr['spec']['ValidityDate'] = $spec->attributes['ValidityDate'];
         $arr['spec']['Unit'] = $spec->attributes['Unit'];
         $arr['spec']['BganCompany'] = $spec->attributes['BganCompany'];
         $arr['spec']['BganGoodsNO'] = $spec->attributes['BganGoodsNO'];
         //商品-包装
         $pack = PapGoodsPack::model()->find('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         $arr['pack']['MinQuantity'] = $pack->attributes['MinQuantity'];
     }
     return $arr;
 }
Ejemplo n.º 3
0
                <div class="float_l  back_color m_left12 ">
                    <div class="txxx_info3">
                        <p><span class="color_red" id="GoodsNO_id">&nbsp;</span> <span>商品编号:</span>
                            <input type="text" id="GoodsNO" name="GoodsNO"  class=" input input3 width250" value="<?php 
echo $data->GoodsNO;
?>
"></p>
                        <p class="m-top"><span class="color_red" id="Pinyin_id">&nbsp;</span> <span>拼音代码:</span>
                            <input type="text" id="Pinyin" name="Pinyin" id="pinyincode" class=" input input3 width250" value="<?php 
echo $data->Pinyin;
?>
" ></p>
                        <p class="m-top">
                            <span  class="m_left12">配件品类:</span>
                            <input id="cpname-search" type="text" class=" input input3 width250" value="<?php 
echo DealergoodsService::StandCodegetcpname($data->StandCode, 'Name');
?>
"  ></p>
                        <p class="m-top"> <span class=" m_left12">商品品牌:</span>
                            <?php 
//                            $organID = Commonmodel::getOrganID();
//                            $brandNames = Brand::model()->findAll("OrganID = $organID");
//                            $brandName = CHtml::listData($brandNames, 'ID', 'BrandName');
//                            $selected = $data->BrandID;
$selected = $data->BrandID;
$brandNames = DealergoodsService::codegetbrand($data->StandCode);
$brandName = $brandNames ? $brandNames : array();
echo CHtml::dropDownList('goodsBrand', $selected, $brandName, array('class' => 'select select2 ', 'empty' => '选择商品品牌'));
?>
	
                            <input type="hidden" name="BrandName">
Ejemplo n.º 4
0
 public static function getredis($GoodsID, $search = '')
 {
     $info = Yii::app()->redis->get('GoodsID' . $GoodsID);
     if ($info) {
         $info = json_decode($info, true);
         //            $info['atBrand'] = Yii::app()->redis->get('Brand' . $Goods->attributes['BrandID'] . 'o' . $Goods->attributes['OrganID']);
     } else {
         $Goods = PapGoods::model()->findBypk($GoodsID);
         //            if ($search != 'search') {
         //                if (!$Goods || $Goods->ISdelete == 0) {
         //                    return 'null';
         //                } else if ($Goods->IsSale == 0) {
         //                    return 'nosale';
         //                }
         //            }
         $redis = $Goods->attributes;
         $brandid = $Goods->attributes['BrandID'];
         if ($brandid) {
             $sql = "select BrandName from pap_brand where ID={$brandid}";
             $res = Yii::app()->papdb->createCommand($sql)->queryRow();
         }
         //if($res['Name']){
         $redis['Brand'] = $res['BrandName'] ? $res['BrandName'] : '';
         //品牌认证
         //}
         //机构名称
         $redis['OrganName'] = DealergoodsService::getnamebyorganid($Goods->attributes['OrganID']);
         $redis['PartsLevelName'] = Yii::app()->getParams()->PartsLevel[$Goods->attributes['PartsLevel']];
         $redis['StandCodeName'] = DealergoodsService::StandCodegetcpname($Goods->attributes['StandCode'], 'Name');
         //var_dump($redis);exit;
         $gcategory = self::getCategory($Goods->attributes['StandCode']);
         //            $version['gcategory'] = $gcategory->attributes;
         $redis['gcategory']['BigParts'] = $gcategory['BigPartsID'];
         $redis['gcategory']['SubParts'] = $gcategory['SubPartsID'];
         $redis['gcategory']['BigName'] = $gcategory['BigParts'];
         $redis['gcategory']['SubName'] = $gcategory['SubParts'];
         $oeno = PapGoodsOeRelation::model()->findAll('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         if ($oeno) {
             foreach ($oeno as $value) {
                 $redis['oeno'][] = $value->attributes['OENO'];
             }
         }
         $img = PapGoodsImageRelation::model()->findAll('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         if ($img) {
             foreach ($img as $key => $value) {
                 $redis['img'][$key]['ImageUrl'] = $value->attributes['ImageUrl'];
                 $redis['img'][$key]['ImageName'] = $value->attributes['ImageName'];
                 $redis['img'][$key]['MallImage'] = $value->attributes['MallImage'];
                 $redis['img'][$key]['BigImage'] = $value->attributes['BigImage'];
             }
         }
         $spec = PapGoodsSpec::model()->find('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         $redis['spec']['ValidityType'] = $spec->attributes['ValidityType'];
         $redis['spec']['ValidityDate'] = $spec->attributes['ValidityDate'];
         $redis['spec']['Unit'] = $spec->attributes['Unit'];
         $redis['spec']['BganCompany'] = $spec->attributes['BganCompany'];
         $redis['spec']['BganGoodsNO'] = $spec->attributes['BganGoodsNO'];
         $pack = PapGoodsPack::model()->find('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         $redis['pack']['MinQuantity'] = $pack->attributes['MinQuantity'];
         $vehicle = PapGoodsVehicleRelation::model()->findAll('GoodsID=:GoodsID', array(':GoodsID' => $GoodsID));
         if ($vehicle) {
             foreach ($vehicle as $value) {
                 $redis['vehicle'][$key]['Make'] = $value->attributes['Make'];
                 $redis['vehicle'][$key]['Car'] = $value->attributes['Car'];
                 $redis['vehicle'][$key]['Year'] = $value->attributes['Year'];
                 $redis['vehicle'][$key]['Model'] = $value->attributes['Model'];
                 $redis['vehicle'][$key]['Marktxt'] = $value->attributes['Marktxt'];
                 $redis['vehicle'][$key]['Cartxt'] = $value->attributes['Cartxt'];
                 $redis['vehicle'][$key]['Modeltxt'] = $value->attributes['Modeltxt'];
             }
         }
         if ($search == 'search') {
             $redis['atBrand'] = Yii::app()->redis->get('Brand' . $Goods->attributes['BrandID'] . 'o' . $Goods->attributes['OrganID']);
             return $redis;
         }
         $info = $redis;
         Yii::app()->redis->set('GoodsID' . $GoodsID, json_encode($redis));
     }
     $info['atBrand'] = Yii::app()->redis->get('Brand' . $Goods->attributes['BrandID'] . 'o' . $Goods->attributes['OrganID']);
     return $info;
 }