diff --git a/service/Application/Admin/Controller/OrderController.class.php b/service/Application/Admin/Controller/OrderController.class.php index 171335717..481f05d48 100755 --- a/service/Application/Admin/Controller/OrderController.class.php +++ b/service/Application/Admin/Controller/OrderController.class.php @@ -2,6 +2,8 @@ namespace Admin\Controller; +use Service\OrderService; + /** * 订单管理 * @author Devil @@ -137,7 +139,15 @@ class OrderController extends CommonController $v['receive_county_name'] = GetRegionName($v['receive_county']); // 商品列表 - $v['goods'] = M('OrderDetail')->where(['order_id'=>$v['id']])->select();; + $goods = M('OrderDetail')->where(['order_id'=>$v['id']])->select(); + if(!empty($goods)) + { + foreach($goods as &$vs) + { + $vs['attribute'] = empty($vs['attribute']) ? null : json_decode($vs['attribute'], true); + } + } + $v['goods'] = $goods; // 描述 $v['describe'] = '共'.count($v['goods']).'件 合计:¥'.$v['total_price'].'元'; @@ -164,6 +174,7 @@ class OrderController extends CommonController { $like_keyword = array('like', '%'.I('keyword').'%'); $where[] = array( + 'order_no' => $like_keyword, 'receive_name' => $like_keyword, 'receive_tel' => $like_keyword, 'receive_address' => $like_keyword, @@ -220,33 +231,14 @@ class OrderController extends CommonController $this->error(L('common_unauthorized_access')); } - // 参数处理 - $id = I('id'); - - // 删除数据 - if(!empty($id)) - { - // 订单模型 - $m = M('Order'); - - // 订单是否存在 - $data = $m->where(array('id'=>$id))->getField('id'); - if(empty($data)) - { - $this->ajaxReturn(L('common_data_no_exist_error'), -2); - } - - // 删除订单 - $status = $m->where(array('id'=>$id))->save(['is_delete_time'=>time()]); - if($status !== false) - { - $this->ajaxReturn(L('common_operation_delete_success')); - } else { - $this->ajaxReturn(L('common_operation_delete_error'), -100); - } - } else { - $this->ajaxReturn(L('common_param_error'), -1); - } + // 删除操作 + $params = $_POST; + $params['user_id'] = $params['value']; + $params['creator'] = $this->admin['id']; + $params['creator_name'] = $this->admin['username']; + $params['user_type'] = 'admin'; + $ret = OrderService::OrderDelete($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); } /** @@ -264,39 +256,13 @@ class OrderController extends CommonController $this->error(L('common_unauthorized_access')); } - // 参数处理 - $id = I('id'); - - // 取消数据 - if(!empty($id)) - { - // 订单模型 - $m = M('Order'); - - // 订单是否存在 - $data = $m->field('id,status')->find($id); - if(empty($data)) - { - $this->ajaxReturn(L('common_data_no_exist_error'), -2); - } - - // 状态 - if(!in_array($data['status'], [0,1])) - { - $this->ajaxReturn('状态不可操作['.L('common_order_admin_status')[$data['status']]['name'].']', -3); - } - - // 取消订单 - $status = $m->where(array('id'=>$id))->save(['status'=>5, 'upd_time'=>time(), 'cancel_time'=>time()]); - if($status !== false) - { - $this->ajaxReturn(L('common_cancel_success')); - } else { - $this->ajaxReturn(L('common_cancel_error'), -100); - } - } else { - $this->ajaxReturn(L('common_param_error'), -1); - } + // 取消操作 + $params = $_POST; + $params['user_id'] = $params['value']; + $params['creator'] = $this->admin['id']; + $params['creator_name'] = $this->admin['username']; + $ret = OrderService::OrderCancel($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); } /** @@ -364,39 +330,13 @@ class OrderController extends CommonController $this->error(L('common_unauthorized_access')); } - // 参数处理 - $id = I('id'); - - // 取消数据 - if(!empty($id)) - { - // 订单模型 - $m = M('Order'); - - // 订单是否存在 - $data = $m->field('id,status')->find($id); - if(empty($data)) - { - $this->ajaxReturn(L('common_data_no_exist_error'), -2); - } - - // 状态 - if(!in_array($data['status'], [3])) - { - $this->ajaxReturn('状态不可操作['.L('common_order_admin_status')[$data['status']]['name'].']', -3); - } - - // 取消订单 - $status = $m->where(array('id'=>$id))->save(['status'=>4, 'upd_time'=>time(), 'success_time'=>time()]); - if($status !== false) - { - $this->ajaxReturn(L('common_operation_collect_success')); - } else { - $this->ajaxReturn(L('common_operation_collect_error'), -100); - } - } else { - $this->ajaxReturn(L('common_param_error'), -1); - } + // 收货操作 + $params = $_POST; + $params['user_id'] = $params['value']; + $params['creator'] = $this->admin['id']; + $params['creator_name'] = $this->admin['username']; + $ret = OrderService::OrderConfirm($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); } } ?> \ No newline at end of file diff --git a/service/Application/Admin/Lang/zh-cn/order.php b/service/Application/Admin/Lang/zh-cn/order.php index 388154291..82dedd946 100755 --- a/service/Application/Admin/Lang/zh-cn/order.php +++ b/service/Application/Admin/Lang/zh-cn/order.php @@ -8,7 +8,7 @@ * @datetime 2016-12-01T21:51:08+0800 */ return array( - 'order_so_keyword_tips' => '姓名/手机/地址/快递单号', + 'order_so_keyword_tips' => '订单号/姓名/手机/地址/快递单号', 'order_time_start_text' => '起始时间', 'order_time_end_text' => '结束时间', diff --git a/service/Application/Admin/View/Default/Order/Index.html b/service/Application/Admin/View/Default/Order/Index.html index e31fbed6d..7836ecef6 100755 --- a/service/Application/Admin/View/Default/Order/Index.html +++ b/service/Application/Admin/View/Default/Order/Index.html @@ -66,13 +66,19 @@
- {{$vs.attribute}} + + + + {{$vss.attr_type_name}}:{{$vss.attr_name}} + + + {{$vs.price}}x{{$vs.buy_number}}
@@ -117,10 +123,10 @@
{{$vs.attribute}} @@ -196,16 +202,16 @@ - + - + - + - + diff --git a/service/Application/Home/Controller/CommonController.class.php b/service/Application/Home/Controller/CommonController.class.php index a2620b386..be3460570 100755 --- a/service/Application/Home/Controller/CommonController.class.php +++ b/service/Application/Home/Controller/CommonController.class.php @@ -335,7 +335,7 @@ class CommonController extends Controller $user['mobile_security']= empty($user['mobile']) ? '' : substr($user['mobile'], 0, 3).'***'.substr($user['mobile'], -3); $user['email_security'] = empty($user['email']) ? '' : substr($user['email'], 0, 3).'***'.substr($user['email'], -3); - // 页面显示名称 + // 显示名称,根据规则优先展示 $user['user_name_view'] = $user['username']; if(empty($user['user_name_view'])) { diff --git a/service/Application/Home/Controller/OrderController.class.php b/service/Application/Home/Controller/OrderController.class.php index 77be2e355..c6c4c8252 100755 --- a/service/Application/Home/Controller/OrderController.class.php +++ b/service/Application/Home/Controller/OrderController.class.php @@ -72,10 +72,18 @@ class OrderController extends CommonController ); $data = OrderService::OrderList($data_params); $this->assign('data_list', $data['data']); + + // 发起支付 - 支付方式 + $this->assign('buy_payment_list', ResourcesService::BuyPaymentList()); - // 品牌分类 - // $brand_category = M('BrandCategory')->where(['is_enable'=>1])->field('id,name')->select(); - // $this->assign('brand_category', $brand_category); + // 支付方式 + $this->assign('payment_list', ResourcesService::PaymentList()); + + // 订单状态 + $this->assign('common_order_user_status', L('common_order_user_status')); + + // 支付状态 + $this->assign('common_order_pay_status', L('common_order_pay_status')); // 参数 $this->assign('params', $params); @@ -129,5 +137,79 @@ class OrderController extends CommonController $this->display('/Public/PayError'); } } + + /** + * 订单取消 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-30 + * @desc description + */ + public function Cancel() + { + if(IS_POST) + { + $params = $_POST; + $params['user_id'] = $this->user['id']; + $params['creator'] = $this->user['id']; + $params['creator_name'] = $this->user['user_name_view']; + $ret = OrderService::OrderCancel($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); + } else { + $this->assign('msg', L('common_unauthorized_access')); + $this->display('/Public/TipsError'); + } + } + + /** + * 订单收货 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-30 + * @desc description + */ + public function Confirm() + { + if(IS_POST) + { + $params = $_POST; + $params['user_id'] = $this->user['id']; + $params['creator'] = $this->user['id']; + $params['creator_name'] = $this->user['user_name_view']; + $ret = OrderService::OrderConfirm($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); + } else { + $this->assign('msg', L('common_unauthorized_access')); + $this->display('/Public/TipsError'); + } + } + + /** + * 订单删除 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-30 + * @desc description + */ + public function Delete() + { + if(IS_POST) + { + $params = $_POST; + $params['user_id'] = $this->user['id']; + $params['creator'] = $this->user['id']; + $params['creator_name'] = $this->user['user_name_view']; + $params['user_type'] = 'user'; + $ret = OrderService::OrderDelete($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); + } else { + $this->assign('msg', L('common_unauthorized_access')); + $this->display('/Public/TipsError'); + } + } + } ?> \ No newline at end of file diff --git a/service/Application/Home/Lang/zh-cn/order.php b/service/Application/Home/Lang/zh-cn/order.php new file mode 100644 index 000000000..35c441c5d --- /dev/null +++ b/service/Application/Home/Lang/zh-cn/order.php @@ -0,0 +1,13 @@ + '没有支付方式', +); +?> \ No newline at end of file diff --git a/service/Application/Home/View/Default/Buy/Index.html b/service/Application/Home/View/Default/Buy/Index.html index f95fd8fee..98136b003 100755 --- a/service/Application/Home/View/Default/Buy/Index.html +++ b/service/Application/Home/View/Default/Buy/Index.html @@ -240,7 +240,7 @@ {{$params.goods_id}}0" /> {{$params.buy_type}}goods" /> {{$params.stock}}1" /> - {{$params.attr}}" /> + {{$params.attr}}' /> {{$params.ids}}" /> diff --git a/service/Application/Home/View/Default/Order/Index.html b/service/Application/Home/View/Default/Order/Index.html index e58c6b040..7341b7f5b 100755 --- a/service/Application/Home/View/Default/Order/Index.html +++ b/service/Application/Home/View/Default/Order/Index.html @@ -14,6 +14,7 @@
+ @@ -21,90 +22,94 @@
-
+
- + {{$params.keywords}}" />
- none"> +
none">
时间: - + {{$params.time_start}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" /> ~ - + {{$params.time_end}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" /> 价格: - + {{$params.price_start}}" /> ~ - + {{$params.price_end}}" />
支付: - + + + + + + 付款: - - - - + + + + +
状态: - + + + + + +
- + - +
-
- +
@@ -117,83 +122,126 @@ - -
商品 单价
data-ongoing"> - - - - - - - - - - -
- title -
-
- - - -
- {{$goods.title}} - -
    - -
  • {{$attr.attr_type_name}}:{{$attr.attr_name}}
  • -
    -
-
-
-
-
- - ¥{{$goods.original_price}} - - ¥{{$goods.price}} - x{{$goods.buy_number}} -
-
- -

¥{{$goods.original_price}}

-
-

¥{{$goods.price}}

-
- x{{$goods.buy_number}} - - ¥{{$order.total_price}} + + + data-ongoing"> + + - - + + + + + + + + + - - 支付 - - - - - - - - + + +
+ {{:date('Y-m-d', $order['add_time'])}} + {{$order.order_no}} - {{$order.status_name}} - - - - +
+
+ + + +
+ {{$goods.title}} + +
    + +
  • {{$attr.attr_type_name}}:{{$attr.attr_name}}
  • +
    +
+
+
+
+
+ + ¥{{$goods.original_price}} + + ¥{{$goods.price}} + x{{$goods.buy_number}} +
+
+ +

¥{{$goods.original_price}}

+
+

¥{{$goods.price}}

+
+ x{{$goods.buy_number}} + + ¥{{$order.total_price}} + + {{$order.status_name}} + + + + + + + + + + + + + + + +
- -
- - + + {{$page_html}} + + +
{{:L('common_not_data_tips')}}
+
- - {{$page_html}} - + +
+
+
+

支付

+ × +
+
+
+ +
+

选择支付

+ +
    + +
  • + + + + {{$payment.name}} + +
  • +
    +
+
+ +
{{:L('order_payment_not_data_tips')}}
+
+
+
+ + + +
+
+
+
+
diff --git a/service/Application/Home/View/Default/User/EmailRegInfo.html b/service/Application/Home/View/Default/User/EmailRegInfo.html index fb46b8f09..8e59084bd 100755 --- a/service/Application/Home/View/Default/User/EmailRegInfo.html +++ b/service/Application/Home/View/Default/User/EmailRegInfo.html @@ -19,7 +19,9 @@
{{:L('user_reg_there_are_accounts_text')}} - {{:L('user_reg_login_immediately_text')}} + + +