Exemplo n.º 1
0
 public function actionResult()
 {
     $lot = new Model_Lot();
     $category = $this->request->cat;
     $result = $lot->searchProductWithCategory($this->request, $category);
     //var_dump($this->request);die();
     $this->view->searchText = $this->request->searchText;
     $this->view->cat = $this->request->cat;
     $this->view->categories = $result;
     $this->view->render('result');
     $this->view->display();
 }
Exemplo n.º 2
0
 public function actionIndex()
 {
     $main = new Model_Lot();
     $this->view->numAnchors = $main->getNumAnchors();
     if ($this->request->page == "") {
         $this->view->lastGoods = $main->getLastGoods();
         $this->view->render('index');
         $this->view->display();
     } else {
         $data = $main->getLastGoods();
         echo json_encode($data);
         exit;
     }
 }
Exemplo n.º 3
0
Arquivo: lot.php Projeto: wxl2012/wx
 /**
  * 拍品详情
  *
  * @param int $id 拍品ID
  */
 public function action_view($id = 0)
 {
     $params = ['title' => '精选拍品'];
     $params['item'] = \Model_Lot::find($id);
     \View::set_global($params);
     $this->template->content = \View::forge("{$this->theme}/lot/view");
 }
Exemplo n.º 4
0
Arquivo: lot.php Projeto: wxl2012/wx
 /**
  * 结束拍品活动
  * @param int $id
  * @throws \Exception
  * @throws \FuelException
  */
 public function action_end($id = 0)
 {
     if (\Input::method() == 'POST') {
         $msg = ['status' => 'err', 'msg' => '', 'errcode' => 10];
         $record = \Model_PlaceBidRecord::query()->where(['lot_id' => $id])->order_by(['bid' => 'DESC'])->get_one();
         $order = \Model_Order::find($record->order_id);
         $order->order_status = 'FINISH';
         if ($order->save()) {
             $msg = ['status' => 'succ', 'msg' => '', 'errcode' => 0];
         }
         if (\Input::is_ajax()) {
             die(json_encode($msg));
         }
         \Session::set_flash('msg', $msg);
     }
     $params = [];
     $params['item'] = \Model_Lot::find($id);
     \View::set_global($params);
     $this->template->content = \View::forge("{$this->theme}/auction/details");
 }
Exemplo n.º 5
0
 public function actionCategory()
 {
     if (empty($this->valueURL)) {
         Application::redirect_in('/404');
     }
     $category = $this->valueURL[0] < 1 ? 1 : $this->valueURL[0];
     $page = 1;
     if (count($this->valueURL) > 2) {
         if ($this->valueURL[1] == 'page') {
             $page = $this->valueURL[2] < 1 ? 1 : $this->valueURL[2];
         }
     }
     $model = new Model_Category();
     $valuesMain['catList'] = $model->getCategoryAll();
     $model = new Model_Lot();
     $values['products'] = $model->getByCategoryID($category, $page);
     $values['category'] = $valuesMain['catList'][$category - 1]['name'];
     $values['pages'] = (int) ceil(count($values['products']) / 6);
     $values['link'] = '/lots/category/' . $valuesMain['catList'][$category - 1]['id'] . '/page/';
     $view = new View();
     $view->addBufferMain('layout', $valuesMain);
     $view->addBuffers('search', $values);
     $view->renderBuffer();
 }