/** * 订单详情 */ public function show($order_id = 0) { if (empty($order_id)) { $this->error('非法参数...'); } $map = array('user_id' => $this->user_info['user_id'], 'order_id' => $order_id); $order_info = M('FxOrder')->where($map)->find(); $order_info['order_info'] = unserialize($order_info['order_info']); $order_info['status_text'] = get_fx_order_status($order_info['status']); $order_info['consign'] = D('UserConsign')->get($order_info['address_id']); $this->assign('info', $order_info); $this->display(); }
public function edit($order_id = 0) { if (empty($order_id)) { $this->error('无效参数'); } $info = $this->db->find($order_id); if (IS_POST) { $status = I('status', '', 'intval'); $gs = I('gs', '', 'trim'); $nu = I('nu', '', 'trim'); $ly = I('ly', '', 'trim'); $order_info = unserialize($info['order_info']); $order_info['kuaidi']['gs'] = $gs; $order_info['kuaidi']['nu'] = $nu; $order_info['kuaidi']['ly'] = $ly; switch ($status) { case '3': //收货操作 $map = array('order_id' => $order_id, 'status' => 2, 'pay_status' => 1); $data = array('order_info' => serialize($order_info), 'status' => 3, 'update_time' => time()); $result = $this->db->where($map)->save($data); break; default: //修改操作 $map = array('order_id' => $order_id); $data = array('order_info' => serialize($order_info)); $result = $this->db->where($map)->save($data); break; } if ($result) { action_log(); $this->updateCache(); $this->success('成功', U('index')); } else { $this->error($this->db->getError()); } } else { if ($info) { $info['order_info'] = unserialize($info['order_info']); $info['status_text'] = get_fx_order_status($info['status']); $info['consign'] = D('Fenxiao/UserConsign')->get($info['address_id']); $this->assign('info', $info); } else { $this->error('不存在!'); } // print_r($info); $this->meta_title = '更新' . $this->title; $this->display(); } }