Example #1
0
 public function items($categoryALias, $orderby = 'id', $from = 0, $to = 4)
 {
     $this->pak->select(self::$getItem)->from('product AS p')->where('p.status', 1);
     $this->pak->join('category AS ca', 'ca.id = p.category', 'left');
     $this->pak->where('ca.alias', $categoryALias);
     $this->pak->order_by('p.' . $orderby, 'desc');
     $data = $this->pak->limit($to, $from)->get()->result();
     // 		bug($this->pak->last_query());
     // 		bug($data); exit;
     if ($data) {
         foreach ($data as $k => $item) {
             $data[$k]->ti = self::lang('name', 'product', $item->id);
             $data[$k]->de = self::lang('desciption', 'product', $item->id);
             if (($img = $this->picasa->parkornCache($item->photo)) && isset($img->src)) {
                 $data[$k]->im = $img->src;
             } else {
                 $data[$k]->im = img_resoure('empty.gif', null, null);
             }
             $data[$k]->pr = $this->pshop->thePrice($item->pr);
             $data[$k]->ca = self::categoryURL($item->ca);
         }
     }
     return $data;
 }
function resoure($file = null, $domain = 'resource_domain')
{
    return img_resoure($file, null, null, $domain, false);
}