diff --git a/crmeb/app/adminapi/route/user.php b/crmeb/app/adminapi/route/user.php index 3b887a786..ad69636b2 100644 --- a/crmeb/app/adminapi/route/user.php +++ b/crmeb/app/adminapi/route/user.php @@ -15,11 +15,12 @@ use think\facade\Route; */ Route::group('user', function () { //用户管理资源路由 - Route::resource('user', 'v1.user.user')->except(['read'])->option([ + Route::resource('user', 'v1.user.user')->option([ 'real_name' => [ 'index' => '获取用户列表', 'create' => '获取用户表单', 'save' => '保存用户', + 'read' => '获取用户详情', 'edit' => '获取修改用户表单', 'update' => '修改用户', 'delete' => '删除用户' diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 82ed1573e..fc166831d 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -605,6 +605,7 @@ class StoreOrderController * 订单统计数据 * @param Request $request * @return mixed + * @throws \ReflectionException */ public function data(Request $request) { diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php index 67c94b37c..c8a62c478 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/crmeb/app/dao/order/StoreOrderDao.php @@ -50,17 +50,19 @@ class StoreOrderDao extends BaseDao $realName = $where['real_name'] ?? ''; $fieldKey = $where['field_key'] ?? ''; $fieldKey = $fieldKey == 'all' ? '' : $fieldKey; + $status = $where['status'] ?? ''; + unset($where['status']); return parent::search($where, $search)->when($isDel, function ($query) use ($where) { $query->where('is_del', $where['is_del']); })->when(isset($where['is_system_del']), function ($query) { $query->where('is_system_del', 0); - })->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) { - switch ((int)$where['status']) { + })->when($status !== '', function ($query) use ($where, $status) { + switch ((int)$status) { case 0://未支付 $query->where('paid', 0)->where('status', 0)->where('refund_status', 0)->where('is_del', 0); break; case 1://已支付 未发货 - $query->where('paid', 1)->whereIn('status', [0, 4])->whereIn('refund_status', [0, 3])->when(isset($where['shipping_type']), function ($query) { + $query->where('paid', 1)->where('status', 0)->whereIn('refund_status', [0, 3])->when(isset($where['shipping_type']), function ($query) { $query->where('shipping_type', 1); })->where('is_del', 0); break; @@ -95,7 +97,7 @@ class StoreOrderDao extends BaseDao $query->where('is_del', 1); break; case 9://全部用户未删除的订单 - $query->where('is_del', 0); + $query->whereIn('refund_status', [0, 3])->where('is_del', 0); break; } })->when(isset($where['paid']) && $where['paid'] !== '', function ($query) use ($where) { diff --git a/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php b/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php index 269a45384..1fd936257 100644 --- a/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php +++ b/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php @@ -363,6 +363,9 @@ class StoreCouponIssueServices extends BaseServices public function issueUserCoupon($id, $user, bool $is_receive = false) { $issueCouponInfo = $this->dao->getInfo((int)$id); + if ($user->is_money_level <= 0 && $issueCouponInfo['receive_type'] == 4) { + throw new ApiException(400097); + } $uid = $user->uid; if (!$issueCouponInfo) throw new ApiException(400516); /** @var StoreCouponIssueUserServices $issueUserService */ diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index a70f05b44..420d9e138 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -93,7 +93,7 @@ class StoreOrderServices extends BaseServices { [$page, $limit] = $this->getPageValue(); $data = $this->dao->getOrderList($where, $field, $page, $limit, $with); - $count = $this->dao->count($where); + $count = $this->dao->count($where, false); $data = $this->tidyOrderList($data); foreach ($data as &$item) { $refund_num = array_sum(array_column($item['refund'], 'refund_num')); diff --git a/template/admin/src/pages/order/orderList/handle/orderDetails.vue b/template/admin/src/pages/order/orderList/handle/orderDetails.vue index cf15bba9b..8d87eed18 100644 --- a/template/admin/src/pages/order/orderList/handle/orderDetails.vue +++ b/template/admin/src/pages/order/orderList/handle/orderDetails.vue @@ -18,7 +18,7 @@ 订单状态:{{ orderDatalist.orderInfo._status._title }} {{ - orderDatalist.orderInfo.refund && orderDatalist.orderInfo.refund.length + orderDatalist.orderInfo.refund && orderDatalist.orderInfo.refund.length && orderDatalist.orderInfo.refund_status < 2 ? orderDatalist.orderInfo.is_all_refund ? '退款中' : '部分退款中'