123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- namespace addons\shopro\controller;
- class Order extends Base
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = ['*'];
- public function index()
- {
- $params = $this->request->get();
- $this->success('订单列表', \addons\shopro\model\Order::getList($params));
- }
- public function detail()
- {
- $params = $this->request->get();
- $this->success('订单详情', \addons\shopro\model\Order::detail($params));
- }
- public function itemDetail()
- {
- $params = $this->request->get();
- $this->success('订单商品', \addons\shopro\model\Order::itemDetail($params));
- }
- // 即将废弃
- public function statusNum () {
- $this->success('订单数量', \addons\shopro\model\Order::statusNum());
- }
- // 取消订单
- public function cancel()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'cancel');
- $this->success('取消成功', \addons\shopro\model\Order::operCancel($params));
- }
- // 删除订单
- public function delete()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'delete');
- $this->success('删除成功', \addons\shopro\model\Order::operDelete($params));
- }
- // 确认收货
- public function confirm()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'confirm');
- $this->success('收货成功', \addons\shopro\model\Order::operConfirm($params));
- }
- public function comment ()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'comment');
- $this->success('评价成功', \addons\shopro\model\Order::operComment($params));
- }
- public function pre()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'pre');
- $result = \addons\shopro\model\Order::pre($params);
- if (isset($result['msg']) && $result['msg']) {
- $this->error($result['msg'], $result);
- } else {
- $this->success('计算成功', $result);
- }
- }
- public function createOrder()
- {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'createOrder');
- $order = \addons\shopro\model\Order::createOrder($params);
- $this->success('订单添加成功', $order);
- }
- // 获取可用优惠券列表
- public function coupons () {
- $params = $this->request->post();
- // 表单验证
- $this->shoproValidate($params, get_class(), 'coupons');
- $coupons = \addons\shopro\model\Order::coupons($params);
- $this->success('获取成功', $coupons);
- }
-
- }
|