public function show($order_id = '') { if (empty($order_id)) { $this->error('非法参数...'); } $order_info = M('Order')->where(array('order_id' => $order_id))->find(); if (empty($order_info)) { $this->error('订单不存在...'); } $order_info['reserve_info'] = unserialize($order_info['reserve_info']); $order_info['order_status_text'] = order_status_text($order_info['order_status']); $order_info['pay_status_text'] = pay_status_text($order_info['pay_status']); switch ($order_info['order_type']) { case 'line': $line = M('Line')->field('title')->where(array('line_id' => $order_info['product_id']))->find(); if ($line) { $order_info['title'] = $line['title']; } else { $order_info['title'] = '不存在'; } break; case 'visa': $visa = M('Visa')->field('title')->where(array('visa_id' => $order_info['product_id']))->find(); if ($visa) { $order_info['title'] = $visa['title']; } else { $order_info['title'] = '不存在'; } break; default: break; } // echo '<pre>'; print_r($order_info); echo '</pre>'; $this->assign('order_info', $order_info); $this->meta_title = '订单详情'; $this->display(); }
public function show($order_id = '') { if (empty($order_id)) { $this->error('非法参数...'); } $order_info = M('Order')->where(array('order_id' => $order_id))->find(); if (empty($order_info)) { $this->error('订单不存在...'); } $order_info['reserve_info'] = unserialize($order_info['reserve_info']); $order_info['order_status_text'] = order_status_text($order_info['order_status']); $order_info['pay_status_text'] = pay_status_text($order_info['pay_status']); switch ($order_info['order_type']) { case 'line': $line = M('Line')->field('title,images,starting')->where(array('line_id' => $order_info['product_id']))->find(); if ($line) { $order_info['title'] = $line['title']; $order_info['image'] = get_cover(array_shift(explode(',', $line['images'])), 'path'); $order_info['starting'] = $line['starting']; } else { $order_info['title'] = '不存在'; $order_info['image'] = ''; $order_info['starting'] = ''; } break; default: break; } // echo '<pre>'; print_r($order_info); echo '</pre>'; $this->assign('order_info', $order_info); $this->meta_title = '线路列表'; $this->display(); }
public function orderShow($order_id = '') { $this->_checkLogin(); if (empty($order_id)) { $this->error('非法参数...'); } $Order = D('Order'); $map = array('user_id' => is_login(), 'order_id' => $order_id); $order_info = $Order->where($map)->find(); if (empty($order_info)) { $this->error('订单不存在...'); } $order_info['reserve_info'] = unserialize($order_info['reserve_info']); $order_info['order_status_text'] = order_status_text($order_info['order_status']); $order_info['pay_status_text'] = pay_status_text($order_info['pay_status']); switch ($order_info['order_type']) { case 'line': $line = M('Line')->field('title,images,start')->where(array('line_id' => $order_info['product_id']))->find(); if ($line) { $order_info['title'] = $line['title']; $order_info['image'] = get_cover(array_shift(explode(',', $line['images'])), 'path'); $order_info['start'] = $line['start']; $order_info['product_url'] = U('Line/show', array('id' => $order_info['product_id'])); } else { $order_info['title'] = '不存在'; $order_info['image'] = ''; $order_info['start'] = ''; $order_info['product_url'] = 'javascript:void(0);'; } break; case 'visa': $visa = M('Visa')->field('title,cover_id')->where(array('visa_id' => $order_info['product_id']))->find(); if ($visa) { $order_info['title'] = $visa['title']; $order_info['image'] = get_cover($visa['cover_id'], 'path'); $order_info['product_url'] = U('Visa/show', array('id' => $order_info['product_id'])); } else { $order_info['title'] = '不存在'; $order_info['image'] = ''; $order_info['product_url'] = 'javascript:void(0);'; } break; default: break; } // echo '<pre>'; print_r($order_info); echo '</pre>'; $this->assign('order_info', $order_info); $this->display(); }