/** * @brief 订单详情 * @return String */ public function order_detail() { $id = IFilter::act(IReq::get('id'), 'int'); $orderObj = new order_class(); $this->order_info = $orderObj->getOrderShow($id, $this->user['user_id']); if (!$this->order_info) { IError::show(403, '订单信息不存在'); } $this->redirect('order_detail', false); }
public function order_report() { //搜索条件 $search = IFilter::act(IReq::get('search'), 'strict'); //条件筛选处理 list($join, $where) = order_class::getSearchCondition($search); //拼接sql $orderHandle = new IQuery('order as o'); $orderHandle->order = "o.id desc"; $orderHandle->fields = "o.*,d.name as distribute_name,u.username,p.name as payment_name"; $orderHandle->join = $join; $orderHandle->where = $where; $orderList = $orderHandle->find(); $strTable = '<table width="500" border="1">'; $strTable .= '<tr>'; $strTable .= '<td style="text-align:center;font-size:12px;width:120px;">订单编号</td>'; $strTable .= '<td style="text-align:center;font-size:12px;width:120px;">商家id</td>'; $strTable .= '<td style="text-align:center;font-size:12px;width:120px;">区</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="100">日期</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">收货人</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">电话</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">订单金额</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">实际支付</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">支付方式</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">支付状态</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">发货状态</td>'; $strTable .= '<td style="text-align:center;font-size:12px;" width="*">商品信息</td>'; $strTable .= '</tr>'; foreach ($orderList as $k => $val) { $strTable .= '<tr>'; $strTable .= '<td style="text-align:center;font-size:12px;"> ' . $val['order_no'] . '</td>'; $strTable .= '<td style="text-align:center;font-size:12px;"> ' . $val['seller_id'] . '</td>'; $strTable .= '<td style="text-align:center;font-size:12px;"> ' . $val['area'] . '</td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['create_time'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['accept_name'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;"> ' . $val['telphone'] . ' ' . $val['mobile'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['payable_amount'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['real_amount'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['payment_name'] . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . Order_Class::getOrderPayStatusText($val) . ' </td>'; $strTable .= '<td style="text-align:left;font-size:12px;">' . Order_Class::getOrderDistributionStatusText($val) . ' </td>'; $orderGoods = Order_class::getOrderGoods($val['id']); $strGoods = ""; foreach ($orderGoods as $good) { $strGoods .= "商品编号:" . $good->goodsno . " 商品名称:" . $good->name; if ($good->value != '') { $strGoods .= " 规格:" . $good->value; } $strGoods .= "<br />"; } unset($orderGoods); $strTable .= '<td style="text-align:left;font-size:12px;">' . $strGoods . ' </td>'; $strTable .= '</tr>'; } $strTable .= '</table>'; unset($orderList); $reportObj = new report(); $reportObj->setFileName('order'); $reportObj->toDownload($strTable); exit; }