From 9447ff6524be2ec3714db3f13ca68e894f9697ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=80=E5=B3=B0?= <1feng.0595@gmail.com> Date: Wed, 4 Jul 2018 10:56:30 +0800 Subject: [PATCH] admin order --- app/Http/Controllers/Admin/OrderController.php | 16 ++++++++-------- resources/views/admin/order/index.blade.php | 2 +- resources/views/admin/tag/index.blade.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Admin/OrderController.php b/app/Http/Controllers/Admin/OrderController.php index ec24c16..3dd4567 100644 --- a/app/Http/Controllers/Admin/OrderController.php +++ b/app/Http/Controllers/Admin/OrderController.php @@ -72,7 +72,7 @@ class OrderController extends CommonController $posts = parent::pageList('order', $where); foreach($posts as $key=>$value) { - $order_status_arr = Order::getOrderStatusText(object_to_array($value, 1)); + $order_status_arr = model('Order')->getOrderStatusAttr($value); $posts[$key]->order_status_text = $order_status_arr?$order_status_arr['text']:''; $posts[$key]->order_status_num = $order_status_arr?$order_status_arr['num']:''; @@ -96,16 +96,16 @@ class OrderController extends CommonController if($data['post']) { - $order_status_arr = Order::getOrderStatusText($data['post']); + $order_status_arr = model('Order')->getOrderStatusAttr($data['post']); $data['post']['order_status_text'] = $order_status_arr?$order_status_arr['text']:''; $data['post']['order_status_num'] = $order_status_arr?$order_status_arr['num']:''; - $data['post']['province_name'] = Region::getRegionName($data['post']['province']); - $data['post']['city_name'] = Region::getRegionName($data['post']['city']); - $data['post']['district_name'] = Region::getRegionName($data['post']['district']); + $data['post']['province_name'] = model('Region')->getRegionName(['id'=>$data['post']->province]); + $data['post']['city_name'] = model('Region')->getRegionName(['id'=>$data['post']->city]); + $data['post']['district_name'] = model('Region')->getRegionName(['id'=>$data['post']->district]); - $data['post']['invoice_text'] = Order::getInvoiceText($data['post']); - $data['post']['place_type_text'] = Order::getPlaceTypeText($data['post']); + $data['post']['invoice_text'] = model('Order')->getInvoiceAttr($data['post']); + $data['post']['place_type_text'] = model('Order')->getPlaceTypeAttr($data['post']); $data['post']['user'] = User::where(array('id'=>$data['post']['user_id']))->first(); //下单人信息 @@ -113,7 +113,7 @@ class OrderController extends CommonController foreach($order_goods as $k=>$v) { - $order_goods[$k]['refund_status_text'] = OrderGoods::getRefundStatusText($v); + $order_goods[$k]['refund_status_text'] = model('OrderGoods')->getRefundStatusAttr($v); } $data['post']['goodslist'] = $order_goods; diff --git a/resources/views/admin/order/index.blade.php b/resources/views/admin/order/index.blade.php index cd1fc09..93119e7 100644 --- a/resources/views/admin/order/index.blade.php +++ b/resources/views/admin/order/index.blade.php @@ -59,7 +59,7 @@ function output_excel()