diff --git a/application/index/controller/Order.php b/application/index/controller/Order.php index 88e712187..49c95213c 100755 --- a/application/index/controller/Order.php +++ b/application/index/controller/Order.php @@ -13,7 +13,6 @@ namespace app\index\controller; use app\service\OrderService; use app\service\PaymentService; use app\service\GoodsCommentsService; -use app\service\OrderAftersaleService; /** * 订单管理 @@ -200,85 +199,6 @@ class Order extends Common } } - /** - * 售后页面 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2019-05-21 - * @desc description - */ - public function Aftersale() - { - // 参数 - $params = input(); - $order_id = isset($params['id']) ? intval($params['id']) : 0; - $goods_id = isset($params['gid']) ? intval($params['gid']) : 0; - $ret = OrderAftersaleService::OrdferGoodsRow($order_id, $goods_id, $this->user['id']); - if($ret['code'] == 0) - { - $this->assign('goods', $ret['data']['items']); - $this->assign('order', $ret['data']); - - // 仅退款原因 - $return_only_money_reason = MyC('home_order_aftersale_return_only_money_reason'); - $this->assign('return_only_money_reason_list', empty($return_only_money_reason) ? [] : explode("\n", $return_only_money_reason)); - - // 退款退货原因 - $return_money_goods_reason = MyC('home_order_aftersale_return_money_goods_reason'); - $this->assign('return_money_goods_reason_list', empty($return_money_goods_reason) ? [] : explode("\n", $return_money_goods_reason)); - - // 获取当前订单商品售后最新的一条纪录 - $data_params = [ - 'm' => 0, - 'n' => 1, - 'where' => [ - ['order_id', '=', $order_id], - ['goods_id', '=', $goods_id], - ['user_id', '=', $this->user['id']], - ], - ]; - $new_aftersale = OrderAftersaleService::OrderGoodsAftersaleList($data_params); - $this->assign('new_aftersale_data', empty($new_aftersale['data'][0]) ? [] : $new_aftersale['data'][0]); - - $this->assign('params', $params); - return $this->fetch(); - } else { - $this->assign('msg', $ret['msg']); - return $this->fetch('public/tips_error'); - } - } - - /** - * 申请售后创建 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2019-05-23 - * @desc description - */ - public function AftersaleCreate() - { - $params = input(); - $params['user'] = $this->user; - return OrderAftersaleService::AftersaleCreate($params); - } - - /** - * 申请售后-用户发货 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2019-05-23 - * @desc description - */ - public function AftersaleDelivery() - { - $params = input(); - $params['user'] = $this->user; - return OrderAftersaleService::AftersaleDelivery($params); - } - /** * 订单支付 * @author Devil diff --git a/application/index/controller/Orderaftersale.php b/application/index/controller/Orderaftersale.php new file mode 100644 index 000000000..849d9a48b --- /dev/null +++ b/application/index/controller/Orderaftersale.php @@ -0,0 +1,240 @@ +IsLogin(); + } + + /** + * 订单列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-28 + * @desc description + */ + public function Index() + { + // 参数 + $params = input(); + $params['user'] = $this->user; + $params['user_type'] = 'user'; + + // 分页 + $number = 10; + + // 条件 + $where = OrderAftersaleService::OrderAftersaleListWhere($params); + + // 获取总数 + $total = OrderAftersaleService::OrderAftersaleTotal($where); + + // 分页 + $page_params = array( + 'number' => $number, + 'total' => $total, + 'where' => $params, + 'page' => isset($params['page']) ? intval($params['page']) : 1, + 'url' => MyUrl('index/orderaftersale/index'), + ); + $page = new \base\Page($page_params); + $this->assign('page_html', $page->GetPageHtml()); + + // 获取列表 + $data_params = array( + 'm' => $page->GetPageStarNumber(), + 'n' => $number, + 'where' => $where, + ); + $data = OrderAftersaleService::OrderAftersaleList($data_params); + $this->assign('data_list', $data['data']); + + // 静态数据 + $this->assign('common_order_aftersale_type_list', lang('common_order_aftersale_type_list')); + $this->assign('common_order_aftersale_status_list', lang('common_order_aftersale_status_list')); + $this->assign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list')); + + // 参数 + $this->assign('params', $params); + return $this->fetch(); + } + + /** + * 订单详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-10-08 + * @desc description + */ + public function Detail() + { + // 参数 + $params = input(); + $params['user'] = $this->user; + $params['user_type'] = 'user'; + + // 条件 + $where = OrderService::OrderListWhere($params); + + // 获取列表 + $data_params = array( + 'm' => 0, + 'n' => 1, + 'where' => $where, + ); + $data = OrderService::OrderList($data_params); + if(!empty($data['data'][0])) + { + // 发起支付 - 支付方式 + $this->assign('buy_payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1])); + + $this->assign('data', $data['data'][0]); + + // 参数 + $this->assign('params', $params); + return $this->fetch(); + } else { + $this->assign('msg', '没有相关数据'); + return $this->fetch('public/tips_error'); + } + } + + /** + * 售后页面 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-21 + * @desc description + */ + public function Aftersale() + { + // 参数 + $params = input(); + $order_id = isset($params['id']) ? intval($params['id']) : 0; + $goods_id = isset($params['gid']) ? intval($params['gid']) : 0; + $ret = OrderAftersaleService::OrdferGoodsRow($order_id, $goods_id, $this->user['id']); + if($ret['code'] == 0) + { + $this->assign('goods', $ret['data']['items']); + $this->assign('order', $ret['data']); + + // 仅退款原因 + $return_only_money_reason = MyC('home_order_aftersale_return_only_money_reason'); + $this->assign('return_only_money_reason_list', empty($return_only_money_reason) ? [] : explode("\n", $return_only_money_reason)); + + // 退款退货原因 + $return_money_goods_reason = MyC('home_order_aftersale_return_money_goods_reason'); + $this->assign('return_money_goods_reason_list', empty($return_money_goods_reason) ? [] : explode("\n", $return_money_goods_reason)); + + // 获取当前订单商品售后最新的一条纪录 + $data_params = [ + 'm' => 0, + 'n' => 1, + 'where' => [ + ['order_id', '=', $order_id], + ['goods_id', '=', $goods_id], + ['user_id', '=', $this->user['id']], + ], + ]; + $new_aftersale = OrderAftersaleService::OrderAftersaleList($data_params); + $this->assign('new_aftersale_data', empty($new_aftersale['data'][0]) ? [] : $new_aftersale['data'][0]); + + // 静态数据 + $this->assign('common_order_aftersale_type_list', lang('common_order_aftersale_type_list')); + + $this->assign('params', $params); + return $this->fetch(); + } else { + $this->assign('msg', $ret['msg']); + return $this->fetch('public/tips_error'); + } + } + + /** + * 申请售后创建 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-23 + * @desc description + */ + public function Create() + { + $params = input(); + $params['user'] = $this->user; + return OrderAftersaleService::AftersaleCreate($params); + } + + /** + * 用户退货 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-23 + * @desc description + */ + public function Delivery() + { + $params = input(); + $params['user'] = $this->user; + return OrderAftersaleService::AftersaleDelivery($params); + } + + /** + * 订单取消 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-30 + * @desc description + */ + public function Cancel() + { + if(input('post.')) + { + $params = input('post.'); + $params['user'] = $this->user; + return OrderAftersaleService::AftersaleCancel($params); + } else { + $this->assign('msg', '非法访问'); + return $this->fetch('public/tips_error'); + } + } +} +?> \ No newline at end of file diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index 611cf51b4..64ed17bd2 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -47,7 +47,7 @@ class Search extends Common $this->params['screening_price_id'] = intval(input('screening_price_id', 0)); // 搜索关键字 - $this->params['keywords'] = str_replace(['?', ' ', '+', '-'], '', trim(input('keywords'))); + $this->params['wd'] = str_replace(['?', ' ', '+', '-'], '', trim(input('wd'))); // 排序方式 $this->params['order_by_field'] = input('order_by_field', 'default'); @@ -68,11 +68,11 @@ class Search extends Common { if(input('post.')) { - $p = empty($this->params['keywords']) ? [] : ['keywords'=>$this->params['keywords']]; + $p = empty($this->params['wd']) ? [] : ['wd'=>$this->params['wd']]; return redirect(MyUrl('index/search/index', $p)); } else { // 品牌列表 - $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->params['category_id'], 'keywords'=>$this->params['keywords']])); + $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->params['category_id'], 'keywords'=>$this->params['wd']])); // 商品分类 $this->assign('category_list', SearchService::GoodsCategoryList(['category_id'=>$this->params['category_id']])); @@ -99,8 +99,9 @@ class Search extends Common * @desc description */ public function GoodsList() - { + { // 获取商品列表 + $this->params['keywords'] = $this->params['wd']; $ret = SearchService::GoodsList($this->params); if(empty($ret['data']['data'])) { diff --git a/application/index/view/default/order/index.html b/application/index/view/default/order/index.html index 4023ac7d1..62302dac2 100755 --- a/application/index/view/default/order/index.html +++ b/application/index/view/default/order/index.html @@ -185,7 +185,7 @@ {{if in_array($order['status'], [2,3,4])}} - 申请售后 + 申请售后 {{/if}} {{if $keys eq 0}} diff --git a/application/index/view/default/order/aftersale.html b/application/index/view/default/orderaftersale/aftersale.html similarity index 80% rename from application/index/view/default/order/aftersale.html rename to application/index/view/default/orderaftersale/aftersale.html index 688ce1522..034627c2c 100644 --- a/application/index/view/default/order/aftersale.html +++ b/application/index/view/default/orderaftersale/aftersale.html @@ -120,64 +120,63 @@
-
-
-
- + {{foreach $common_order_aftersale_type_list as $v}} +
+
+
+ +
+

{{$v.name}}

+

{{$v.desc}}

-

仅退款

-

未收到货(未签收),协商同意前提下

-
-
-
-
- -
-

退货退款

-

已收到货,需要退换已收到的货物

-
-
+ {{/foreach}}
- {{include file="order/aftersale_step" /}} + {{include file="orderaftersale/step" /}}
- {{include file="order/aftersale_create" /}} + {{include file="orderaftersale/create" /}}
{{else /}} - {{include file="order/aftersale_step" /}} + {{include file="orderaftersale/step" /}} {{switch $new_aftersale_data.status}} {{case 0}}
- 当前订单商品售后已提交申请,等待管理员确认中!详情查看 + 当前订单商品售后已提交申请,等待管理员确认中!详情查看
{{/case}} {{case 1}} -
-
- {{include file="order/aftersale_delivery" /}} + {{if $new_aftersale_data['type'] eq 1}} +
+
+ {{include file="orderaftersale/delivery" /}} +
-
+ {{else /}} +
+ 当前订单商品售后已提交申请,等待管理员确认中!详情查看 +
+ {{/if}} {{/case}} {{case 2}}
- 当前订单商品售后已退货,等待管理员审核中!详情查看 + 当前订单商品售后已退货,等待管理员审核中!详情查看
{{/case}} {{case 3}}
- 当前订单商品售后已处理结束!详情查看 + 当前订单商品售后已处理结束!详情查看
{{/case}} {{/switch}} diff --git a/application/index/view/default/order/aftersale_create.html b/application/index/view/default/orderaftersale/create.html similarity index 97% rename from application/index/view/default/order/aftersale_create.html rename to application/index/view/default/orderaftersale/create.html index b2e59ad77..e46517d31 100644 --- a/application/index/view/default/order/aftersale_create.html +++ b/application/index/view/default/orderaftersale/create.html @@ -1,4 +1,4 @@ -
+
diff --git a/application/index/view/default/orderaftersale/index.html b/application/index/view/default/orderaftersale/index.html new file mode 100644 index 000000000..3185bb699 --- /dev/null +++ b/application/index/view/default/orderaftersale/index.html @@ -0,0 +1,174 @@ +{{include file="public/header" /}} + + +{{include file="public/header_top_nav" /}} + + +{{include file="public/nav_search" /}} + + +{{include file="public/header_nav" /}} + + +{{include file="public/goods_category" /}} + + +
+ + + {{include file="public/user_menu" /}} + + + +
+
+ + +
+
+ + + + +
+ +
+ + + + + + + + + + + +
+ 类型: + + + 状态: + +
+ 退款: + + + + 清除条件 +
+ + + + +
+ + + + + + + + + + + + {{if !empty($data_list)}} + {{foreach $data_list as $v}} + + + + + + + + {{/foreach}} + {{/if}} + +
申请信息凭证状态快递信息操作
+ 类型:{{$v.type_text}}
+ 原因:{{$v.reason}}
+ 数量:{{$v.number}}
+ 金额:{{$v.price}}
+ 说明:{{$v.msg}}
+ 时间:{{$v.apply_time_time}} +
+ {{if !empty($v['images'])}} +
+
    + {{foreach $v.images as $img}} +
  • + +
  • + {{/foreach}} +
+
+ {{/if}} +
+

{{$v.status_text}}

+ {{if $v['status'] eq 3 and !empty($v['refundment_text'])}} + {{$v.refundment_text}} + {{/if}} + {{if $v['status'] eq 4 and !empty($v['refuse_reason'])}} + {{$v.refuse_reason}} + {{/if}} +
+ {{if $v['type'] eq 1 and in_array($v['status'], [2,3])}} + 快递:{{$v.express_name}}
+ 单号:{{$v.express_number}}
+ 时间:{{$v.delivery_time_time}} + {{/if}} +
+ {{if in_array($v['status'], [0,3])}} + + {{/if}} + 详情 +
+ + {{if empty($data_list)}} +
没有相关数据
+ {{/if}} +
+ + + {{if !empty($data_list)}} + {{$page_html|raw}} + {{/if}} +
+
+ +
+ + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/index/view/default/order/aftersale_step.html b/application/index/view/default/orderaftersale/step.html similarity index 97% rename from application/index/view/default/order/aftersale_step.html rename to application/index/view/default/orderaftersale/step.html index 0b90567bf..0752f03d5 100644 --- a/application/index/view/default/order/aftersale_step.html +++ b/application/index/view/default/orderaftersale/step.html @@ -5,7 +5,7 @@ -
  • +
  • 2 管理员审核 {{if isset($new_aftersale_data['status']) and $new_aftersale_data['status'] elt 3 and $new_aftersale_data['status'] egt 0}} diff --git a/application/index/view/default/public/footer_nav.html b/application/index/view/default/public/footer_nav.html index 43c3d202e..594083834 100755 --- a/application/index/view/default/public/footer_nav.html +++ b/application/index/view/default/public/footer_nav.html @@ -90,7 +90,7 @@ {{$Think.APPLICATION_VERSION}}

    - {{:MyC('home_site_icp')}} + {{:MyC('home_site_icp')}}

  • diff --git a/application/index/view/default/public/nav_search.html b/application/index/view/default/public/nav_search.html index 1ab20fb06..07d22a787 100755 --- a/application/index/view/default/public/nav_search.html +++ b/application/index/view/default/public/nav_search.html @@ -14,13 +14,13 @@