예제 #1
0
 /**
  * 获取OE号
  */
 public static function getOENOSByGoodsID($goodsID)
 {
     $key = 'oenu_' . $goodsID;
     $OENOS = Yii::app()->cache->get($key);
     if (!$OENOS) {
         $goodsOES = PapGoodsOeRelation::model()->findAll("GoodsID={$goodsID}");
         $data = array();
         $OENOS = '';
         foreach ($goodsOES as $key => $value) {
             $data[$key]['ID'] = $value['ID'];
             $data[$key]['OENO'] = $value['OENO'];
             if ($key == 0) {
                 $OENOS .= $value['OENO'];
             } else {
                 $OENOS .= '、' . $value['OENO'];
             }
         }
         Yii::app()->cache->set($key, $OENOS);
     }
     return $OENOS;
 }
예제 #2
0
파일: PapGoods.php 프로젝트: zwq/unpei
 /**
  * 获取OE号
  */
 public static function getOENOSByGoodsID($goodsID)
 {
     $goodsOES = PapGoodsOeRelation::model()->findAll("GoodsID={$goodsID}");
     $data = array();
     $OENOS = '';
     foreach ($goodsOES as $key => $value) {
         $data[$key]['ID'] = $value['ID'];
         $data[$key]['OENO'] = $value['OENO'];
         if ($key == 0) {
             $OENOS .= $value['OENO'];
         } else {
             $OENOS .= '、' . $value['OENO'];
         }
     }
     // return $data;
     return $OENOS;
 }
예제 #3
0
 public static function editoegoods($pid, $organID, $goods)
 {
     $oenos = $goods['OENOS'];
     $oelegth = count($oenos);
     for ($i = 0; $i < $oelegth; $i++) {
         $goodsoeno = new PapGoodsOeRelation();
         $goodsoeno->OrganID = $organID;
         $goodsoeno->GoodsID = $pid;
         $goodsoeno->OENO = $oenos[$i];
         $goodsoeno->CreateTime = time();
         $goodsoeno->save();
         $oeno[$i] = $oenos[$i];
     }
     return $oeno;
 }