/** * 出价 * @param int $id 拍品ID */ public function action_bid($id = 0) { if (\Input::method() == 'POST') { $msg = ['status' => 'err', 'msg' => '', 'errcode' => 10]; $order_no = \Model_Order::get_order_on(); $data = ['order_no' => $order_no, 'order_type' => 'AUCTION', 'buyer_id' => \Auth::get_user()->id, 'from_id' => \Session::get('seller')->id, 'total_fee' => \Input::post('bid'), 'original_fee' => \Input::post('bid')]; $order = \Model_Order::forge($data); $order->details = [\Model_OrderDetail::forge(['goods_id' => $id, 'num' => 1, 'price' => \Input::post('bid')])]; if ($order->save()) { $msg = ['status' => 'succ', 'msg' => '', 'errcode' => 0]; } if (\Input::is_ajax()) { die(json_encode($msg)); } \Session::set_flash('msg', $msg); } }