示例#1
0
 public function action_index()
 {
     $this->data['product'] = Model_Base_Product::get_by(array('where' => array(array('status', '=', 1))));
     $total_product = Model_Base_Product::count_by(array('where' => array(array('status', '=', 1))));
     View::set_global('total_page', ceil($total_product / _DEFAULT_LIMIT_));
     $this->template->title = 'Product List';
     $this->template->content = View::forge($this->layout . '/product/list', $this->data);
 }
示例#2
0
文件: home.php 项目: khoapld/wjshop
 public function action_home()
 {
     $this->data['highlight_product'] = Model_Base_Product::get_by(array('where' => array(array('highlight', '=', 1), array('status', '=', 1)), 'limit' => 5));
     $this->data['new_product'] = Model_Base_Product::get_by(array('where' => array(array('status', '=', 1)), 'limit' => 8));
     $this->data['product_category'] = Model_Base_Category::get_all(array('where' => array(array('parent_category_id', '=', 0), array('status', '=', 1))));
     foreach ($this->data['product_category'] as $key => $value) {
         $this->data['product_category'][$key]['product'] = Model_Base_Product::get_by_category($value['id'], 0, 4);
     }
     $this->template->title = 'Home Page';
     $this->template->content = View::forge($this->layout . '/home/home', $this->data);
 }