/** * 拍品详情 * * @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"); }
/** * 结束拍品活动 * @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"); }