예제 #1
0
 function getProductSpec($productGenSpecId)
 {
     $productSpec = new productspec();
     $productSpec->where('product_id', $this->id);
     $productSpec->where('productgenspec_id', $productGenSpecId);
     $productSpec->get();
     if (!$productSpec->exists()) {
         return false;
     } else {
         return $productSpec;
     }
 }
예제 #2
0
 function save($object = '', $related_field = '')
 {
     if ($this->position == NULL || $this->position == 0) {
         $o = new productspec();
         $o->where("product_id", $this->product_id);
         $o->select_max('position');
         $o->get();
         if (count($o->all) != 0) {
             $max = $o->position + 1;
             $this->position = $max;
         } else {
             $this->postion = 1;
         }
     }
     return parent::save($object, $related_field);
 }
예제 #3
0
 function saveNewProductSpec($id)
 {
     $product = new product($id);
     $productGenSpec = new productgenspec($this->input->post('newProductSpecId'));
     $ps = new productspec();
     $ps->where('productgenspec_id', $productGenSpec->id);
     $ps->where('product_id', $id);
     $ps->get();
     if ($ps->result_count() == 0) {
         $productSpec = new productspec();
         $productSpec->product_id = $id;
         $productSpec->save(array('productgenspec' => $productGenSpec));
     }
 }
예제 #4
0
                   ?>
           				</div>
                           <?php 
                   $h = 0;
                   foreach ($this->compareProduct as $r) {
                       $h++;
                       ?>
                               <?php 
                       if ($h > 1) {
                           ?>
                                   <div class="p_r_txt" style="width: 250px;padding-left:10px;padding-right:10px;" >
                                   <?php 
                           $pSpec = new productspec();
                           $pSpec->where('productgenspec_id', $spec->productgenspec_id);
                           $pSpec->where('product_id', $r->id);
                           $pSpec->get();
                           if ($pSpec->exists()) {
                               echo $pSpec->value;
                           }
                           $pSpec->clear();
                           ?>
 
                                   </div>
                               <?php 
                       }
                       ?>
                           <?php 
                   }
                   ?>
           				<div class="clr"></div>
           			</div>