ソースを参照

Merge branch 'v4.7.0dev' into v5.0.0dev

# Conflicts:
#	crmeb/app/api/controller/v1/order/StoreOrderController.php
#	crmeb/app/listener/notice/NoticeListener.php
#	template/admin/src/styles/style.css
#	template/admin/src/utils/modalForm.js
#	template/uni-app/pages/goods/order_confirm/index.vue
#	template/uni-app/pages/users/user_info/index.vue
From-wh 2 年 前
コミット
91b0c98929
100 ファイル変更688 行追加327 行削除
  1. 4 0
      crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php
  2. 5 1
      crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php
  3. 1 1
      crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php
  4. 3 0
      crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php
  5. 3 2
      crmeb/app/adminapi/controller/v1/order/RefundOrder.php
  6. 17 1
      crmeb/app/adminapi/controller/v1/order/StoreOrder.php
  7. 2 0
      crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php
  8. 10 0
      crmeb/app/adminapi/controller/v1/product/StoreCategory.php
  9. 6 2
      crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
  10. 13 0
      crmeb/app/adminapi/controller/v1/user/User.php
  11. 2 3
      crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
  12. 8 8
      crmeb/app/api/controller/v1/admin/StoreOrderController.php
  13. 1 3
      crmeb/app/api/controller/v1/order/StoreOrderController.php
  14. 4 0
      crmeb/app/api/controller/v1/store/CategoryController.php
  15. 4 0
      crmeb/app/api/controller/v1/store/StoreCouponsController.php
  16. 3 0
      crmeb/app/api/controller/v1/user/UserRechargeController.php
  17. 7 0
      crmeb/app/api/controller/v2/activity/LuckLotteryController.php
  18. 5 1
      crmeb/app/api/controller/v2/user/UserInvoiceController.php
  19. 7 2
      crmeb/app/dao/article/ArticleCategoryDao.php
  20. 4 3
      crmeb/app/dao/order/StoreOrderDao.php
  21. 8 1
      crmeb/app/dao/user/UserBrokerageDao.php
  22. 3 0
      crmeb/app/dao/user/UserDao.php
  23. 1 0
      crmeb/app/dao/wechat/WechatQrcodeRecordDao.php
  24. 4 4
      crmeb/app/jobs/UnpaidOrderCancelJob.php
  25. 5 4
      crmeb/app/listener/notice/NoticeListener.php
  26. 6 4
      crmeb/app/listener/order/OrderPaySuccessListener.php
  27. 0 2
      crmeb/app/model/system/store/SystemStore.php
  28. 1 1
      crmeb/app/model/user/MemberCardBatch.php
  29. 10 0
      crmeb/app/model/user/User.php
  30. 1 1
      crmeb/app/model/wechat/WechatQrcode.php
  31. 16 19
      crmeb/app/services/activity/coupon/StoreCouponIssueServices.php
  32. 2 0
      crmeb/app/services/activity/coupon/StoreCouponUserServices.php
  33. 1 1
      crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php
  34. 4 1
      crmeb/app/services/activity/integral/StoreIntegralOrderServices.php
  35. 4 1
      crmeb/app/services/activity/live/LiveAnchorServices.php
  36. 4 0
      crmeb/app/services/activity/live/LiveRoomServices.php
  37. 11 7
      crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php
  38. 11 1
      crmeb/app/services/activity/lottery/LuckLotteryServices.php
  39. 12 4
      crmeb/app/services/activity/seckill/StoreSeckillServices.php
  40. 6 15
      crmeb/app/services/article/ArticleCategoryServices.php
  41. 1 1
      crmeb/app/services/order/OutStoreOrderServices.php
  42. 11 6
      crmeb/app/services/order/StoreCartServices.php
  43. 1 1
      crmeb/app/services/order/StoreOrderCreateServices.php
  44. 1 0
      crmeb/app/services/order/StoreOrderDeliveryServices.php
  45. 15 6
      crmeb/app/services/order/StoreOrderInvoiceServices.php
  46. 8 7
      crmeb/app/services/order/StoreOrderRefundServices.php
  47. 9 20
      crmeb/app/services/order/StoreOrderServices.php
  48. 1 0
      crmeb/app/services/order/StoreOrderSplitServices.php
  49. 9 3
      crmeb/app/services/other/export/ExportServices.php
  50. 3 0
      crmeb/app/services/pay/PayNotifyServices.php
  51. 5 1
      crmeb/app/services/pay/PayServices.php
  52. 7 4
      crmeb/app/services/product/product/StoreCategoryServices.php
  53. 3 0
      crmeb/app/services/product/product/StoreProductCouponServices.php
  54. 3 3
      crmeb/app/services/product/product/StoreProductServices.php
  55. 3 0
      crmeb/app/services/statistic/CapitalFlowServices.php
  56. 3 0
      crmeb/app/services/user/UserAddressServices.php
  57. 15 2
      crmeb/app/services/user/UserBrokerageServices.php
  58. 1 0
      crmeb/app/services/user/UserCancelServices.php
  59. 12 7
      crmeb/app/services/user/UserExtractServices.php
  60. 3 1
      crmeb/app/services/user/UserLabelRelationServices.php
  61. 11 2
      crmeb/app/services/user/UserLabelServices.php
  62. 41 17
      crmeb/app/services/user/UserRechargeServices.php
  63. 40 6
      crmeb/app/services/user/UserServices.php
  64. 4 0
      crmeb/app/services/user/member/MemberCardBatchServices.php
  65. 8 9
      crmeb/app/services/user/member/MemberCardServices.php
  66. 2 0
      crmeb/app/services/wechat/WechatQrcodeCateServices.php
  67. 1 1
      crmeb/app/services/wechat/WechatQrcodeServices.php
  68. 0 2
      crmeb/crmeb/services/AliPayService.php
  69. 1 4
      crmeb/crmeb/services/app/WechatService.php
  70. 0 3
      crmeb/crmeb/services/pay/storage/AllinPay.php
  71. 1 7
      crmeb/crmeb/services/pay/storage/V3WechatPay.php
  72. 2 1
      template/admin/src/api/order.js
  73. 5 0
      template/admin/src/components/from/from.vue
  74. 39 3
      template/admin/src/components/goodsList/index.vue
  75. 1 1
      template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less
  76. 1 1
      template/admin/src/components/main/components/tags-nav/tags-nav.less
  77. 1 1
      template/admin/src/pages/app/wechat/reply/follow.vue
  78. 1 1
      template/admin/src/pages/cms/addArticle/index.vue
  79. 4 4
      template/admin/src/pages/kefu/mobile/chat_list.vue
  80. 1 1
      template/admin/src/pages/kefu/pc/components/rightMenu.vue
  81. 25 7
      template/admin/src/pages/marketing/channelCode/channelCodeIndex.vue
  82. 3 2
      template/admin/src/pages/marketing/channelCode/createCode.vue
  83. 60 40
      template/admin/src/pages/marketing/live/add_goods.vue
  84. 7 3
      template/admin/src/pages/marketing/live/anchor.vue
  85. 5 4
      template/admin/src/pages/marketing/live/components/live_detail.vue
  86. 10 5
      template/admin/src/pages/marketing/live/creat_live.vue
  87. 5 2
      template/admin/src/pages/marketing/live/index.vue
  88. 2 2
      template/admin/src/pages/marketing/live/live_goods.vue
  89. 6 5
      template/admin/src/pages/marketing/point_record/index.vue
  90. 12 2
      template/admin/src/pages/marketing/storeBargain/create.vue
  91. 1 1
      template/admin/src/pages/marketing/storeCouponIssue/create.vue
  92. 6 7
      template/admin/src/pages/marketing/storeCouponIssue/index.vue
  93. 1 1
      template/admin/src/pages/marketing/storeCouponUser/index.vue
  94. 7 5
      template/admin/src/pages/marketing/storeIntegralOrder/components/tableFrom.vue
  95. 9 8
      template/admin/src/pages/marketing/storeSeckill/create.vue
  96. 8 5
      template/admin/src/pages/marketing/storeSeckill/statistics.vue
  97. 9 6
      template/admin/src/pages/order/invoice/index.vue
  98. 14 2
      template/admin/src/pages/order/orderList/handle/orderDetails.vue
  99. 1 1
      template/admin/src/pages/order/orderList/handle/orderSend.vue
  100. 0 0
      template/admin/src/pages/product/productAdd/index.vue

+ 4 - 0
crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php

@@ -165,10 +165,14 @@ class ArticleCategory extends AuthController
     /**
      * 树形列表
      * @return mixed
+     * @throws \ReflectionException
      */
     public function getTreeList()
     {
         $list = $this->service->getTreeList();
+        foreach ($list as &$item) {
+            $item['disabled'] = !$item['status'] || $item['is_del'];
+        }
         return app('json')->success($list);
     }
 }

+ 5 - 1
crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php

@@ -135,7 +135,11 @@ class StoreSeckill extends AuthController
 
     /**
      * 秒杀统计
+     * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function seckillStatistics($id)
     {
@@ -151,7 +155,7 @@ class StoreSeckill extends AuthController
     public function seckillPeople($id)
     {
         [$keyword] = $this->request->getMore([
-            ['keyword', '']
+            ['real_name', '', '', 'keyword']
         ], true);
         return app('json')->success($this->services->seckillPeople($id, $keyword));
     }

+ 1 - 1
crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php

@@ -37,7 +37,7 @@ class StorePointRecord extends AuthController
     {
         $where = $this->request->getMore([
             ['time', ''],
-            ['trading_type', 0]
+            ['trading_type', '']
         ]);
         $date = $this->services->pointRecord($where);
         return app('json')->success($date);

+ 3 - 0
crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php

@@ -85,6 +85,9 @@ class LuckLottery extends AuthController
     /**
      * 添加抽奖
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function add()
     {

+ 3 - 2
crmeb/app/adminapi/controller/v1/order/RefundOrder.php

@@ -146,7 +146,7 @@ class RefundOrder extends AuthController
             return app('json')->fail(400144);
         }
 
-        if ($data['type'] == 1) {
+        if ($data['type'] == 1 || $data['type'] == 5) {
             $data['refund_type'] = 6;
         } else if ($data['type'] == 2) {
             $data['refund_type'] = 3;
@@ -190,7 +190,8 @@ class RefundOrder extends AuthController
             $refund_data['open_id'] = $wechatUserServices->uidToOpenid((int)$order['uid'], 'routine') ?? '';
             $refund_data['refund_no'] = $orderRefund['order_id'];
             //修改订单退款状态
-            $data['refund_price'] = $data['refunded_price'];
+//            $data['refund_price'] = $data['refunded_price'];
+            unset($data['refund_price']);
             if ($this->services->agreeRefund($id, $refund_data)) {
                 $this->services->update($id, $data);
                 return app('json')->success(400149);

+ 17 - 1
crmeb/app/adminapi/controller/v1/order/StoreOrder.php

@@ -263,6 +263,9 @@ class StoreOrder extends AuthController
      * @param $id
      * @param StoreOrderDeliveryServices $services
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function split_delivery($id, StoreOrderDeliveryServices $services)
     {
@@ -317,7 +320,11 @@ class StoreOrder extends AuthController
 
     /**
      * 获取订单拆分子订单列表
+     * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function split_order($id)
     {
@@ -455,10 +462,11 @@ class StoreOrder extends AuthController
      * 订单详情
      * @param $id 订单id
      * @return mixed
+     * @throws \ReflectionException
      */
     public function order_info($id)
     {
-        if (!$id || !($orderInfo = $this->services->get($id))) {
+        if (!$id || !($orderInfo = $this->services->get($id, [], ['refund']))) {
             return app('json')->fail(400118);
         }
         /** @var UserServices $services */
@@ -497,6 +505,13 @@ class StoreOrder extends AuthController
         } else
             $orderInfo['_store_name'] = '';
         $orderInfo['spread_name'] = $services->value(['uid' => $orderInfo['spread_uid']], 'nickname') ?? '无';
+        $orderInfo['_info'] = app()->make(StoreOrderCartInfoServices::class)->getOrderCartInfo((int)$orderInfo['id']);
+        $cart_num = 0;
+        $refund_num = array_sum(array_column($orderInfo['refund'], 'refund_num'));
+        foreach ($orderInfo['_info'] as $items) {
+            $cart_num += $items['cart_info']['cart_num'];
+        }
+        $orderInfo['is_all_refund'] = $refund_num == $cart_num;
         $userInfo = $userInfo->toArray();
         return app('json')->success(compact('orderInfo', 'userInfo'));
     }
@@ -551,6 +566,7 @@ class StoreOrder extends AuthController
 
     /**
      * 不退款表单结构
+     * @param StoreOrderRefundServices $services
      * @param $id
      * @return mixed
      * @throws \FormBuilder\Exception\FormBuilderException

+ 2 - 0
crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php

@@ -45,6 +45,8 @@ class StoreOrderInvoice extends AuthController
     {
         $where = $this->request->getMore([
             ['data', '', '', 'time'],
+            ['real_name', ''],
+            ['field_key', ''],
             [['type', 'd'], 0],
         ]);
         $data = $this->services->chart($where);

+ 10 - 0
crmeb/app/adminapi/controller/v1/product/StoreCategory.php

@@ -57,7 +57,11 @@ class StoreCategory extends AuthController
 
     /**
      * 商品分类搜索
+     * @param $type
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function tree_list($type)
     {
@@ -103,6 +107,9 @@ class StoreCategory extends AuthController
     /**
      * 保存新增分类
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save()
     {
@@ -133,6 +140,9 @@ class StoreCategory extends AuthController
      * 更新分类
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function update($id)
     {

+ 6 - 2
crmeb/app/adminapi/controller/v1/setting/SystemNotification.php

@@ -34,8 +34,10 @@ class SystemNotification extends AuthController
 
     /**
      * 显示资源列表
-     *
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function index()
     {
@@ -47,8 +49,10 @@ class SystemNotification extends AuthController
 
     /**
      * 显示编辑
-     *
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function info()
     {

+ 13 - 0
crmeb/app/adminapi/controller/v1/user/User.php

@@ -170,6 +170,9 @@ class User extends AuthController
      * 获取用户账户详情
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function read($id)
     {
@@ -194,6 +197,9 @@ class User extends AuthController
      * 执行赠送会员等级
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save_give_level($id)
     {
@@ -208,6 +214,7 @@ class User extends AuthController
      * 赠送付费会员时长表单
      * @param $id
      * @return mixed
+     * @throws \FormBuilder\Exception\FormBuilderException
      */
     public function give_level_time($id)
     {
@@ -219,6 +226,9 @@ class User extends AuthController
      * 执行赠送付费会员时长
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save_give_level_time($id)
     {
@@ -387,6 +397,9 @@ class User extends AuthController
         if ($data['phone']) {
             if (!preg_match("/^1[3456789]\d{9}$/", $data['phone'])) return app('json')->fail(400252);
         }
+        if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0, 'not_uid' => $id])) {
+            return app('json')->fail(400314);
+        }
         if ($data['card_id']) {
             if (!check_card($data['card_id'])) return app('json')->fail(400315);
         }

+ 2 - 3
crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php

@@ -43,14 +43,13 @@ class MemberCardBatch extends AuthController
     {
         $where = $this->request->getMore([
             ['title', ''],
-//            ['page', 1],
-//            ['limit', 20],
         ]);
         $data = $this->services->getList($where);
         return app('json')->success($data);
     }
 
-    /** 保存卡片资源
+    /**
+     * 保存卡片资源
      * @param $id
      * @return mixed
      */

+ 8 - 8
crmeb/app/api/controller/v1/admin/StoreOrderController.php

@@ -15,6 +15,7 @@ use app\services\order\DeliveryServiceServices;
 use app\services\order\StoreOrderCartInfoServices;
 use app\services\order\StoreOrderCreateServices;
 use app\services\order\StoreOrderDeliveryServices;
+use app\services\order\StoreOrderEconomizeServices;
 use app\services\order\StoreOrderRefundServices;
 use app\services\order\StoreOrderServices;
 use app\services\order\StoreOrderWapServices;
@@ -105,17 +106,16 @@ class StoreOrderController
      * @param UserServices $userServices
      * @param $orderId
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function detail(Request $request, StoreOrderServices $services, UserServices $userServices, $orderId)
     {
-        $order = $this->service->getOne(['order_id' => $orderId], '*', ['pink']);
-        if (!$order) return app('json')->fail(410173);
-        $order = $order->toArray();
-        $nickname = $userServices->value(['uid' => $order['uid']], 'nickname');
-        $orderInfo = $services->tidyOrder($order, true);
-        unset($orderInfo['uid'], $orderInfo['seckill_id'], $orderInfo['pink_id'], $orderInfo['combination_id'], $orderInfo['bargain_id'], $orderInfo['status'], $orderInfo['total_postage']);
-        $orderInfo['nickname'] = $nickname;
-        return app('json')->success($orderInfo);
+        $economizeServices = app()->make(StoreOrderEconomizeServices::class);
+        $orderData = $services->getUserOrderByKey($economizeServices, $orderId, (int)$request->uid());
+        $orderData['nickname'] = $userServices->value(['uid' => $orderData['uid']], 'nickname');
+        return app('json')->success($orderData);
     }
 
     /**

+ 1 - 3
crmeb/app/api/controller/v1/order/StoreOrderController.php

@@ -263,9 +263,6 @@ class StoreOrderController
             return app('json')->fail(410215);
         }
 
-        //重新生成订单号去支付
-//        $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
-
         //0元支付
         if (bcsub((string)$orderInfo['pay_price'], '0', 2) <= 0) {
             //创建订单jspay支付
@@ -430,6 +427,7 @@ class StoreOrderController
      * 订单删除
      * @param Request $request
      * @return mixed
+     * @throws \Psr\SimpleCache\InvalidArgumentException
      */
     public function del(Request $request)
     {

+ 4 - 0
crmeb/app/api/controller/v1/store/CategoryController.php

@@ -28,7 +28,11 @@ class CategoryController
 
     /**
      * 获取分类列表
+     * @param Request $request
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function category(Request $request)
     {

+ 4 - 0
crmeb/app/api/controller/v1/store/StoreCouponsController.php

@@ -50,6 +50,9 @@ class StoreCouponsController
      * 领取优惠券
      * @param Request $request
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function receive(Request $request)
     {
@@ -82,6 +85,7 @@ class StoreCouponsController
      * @param StoreCouponIssueServices $service
      * @param $cartId
      * @param $new
+     * @param $shippingType
      * @return mixed
      * @throws \Psr\SimpleCache\InvalidArgumentException
      * @throws \think\db\exception\DataNotFoundException

+ 3 - 0
crmeb/app/api/controller/v1/user/UserRechargeController.php

@@ -36,6 +36,9 @@ class UserRechargeController
      * 用户充值
      * @param Request $request
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function recharge(Request $request)
     {

+ 7 - 0
crmeb/app/api/controller/v2/activity/LuckLotteryController.php

@@ -102,7 +102,11 @@ class LuckLotteryController
     /**
      * 领取奖品
      * @param Request $request
+     * @param LuckLotteryRecordServices $lotteryRecordServices
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function lotteryReceive(Request $request, LuckLotteryRecordServices $lotteryRecordServices)
     {
@@ -125,6 +129,9 @@ class LuckLotteryController
      * @param Request $request
      * @param LuckLotteryRecordServices $lotteryRecordServices
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function lotteryRecord(Request $request, LuckLotteryRecordServices $lotteryRecordServices)
     {

+ 5 - 1
crmeb/app/api/controller/v2/user/UserInvoiceController.php

@@ -142,7 +142,11 @@ class UserInvoiceController
         $uid = (int)$request->uid();
         $re = $this->services->saveInvoice($uid, $data);
         if ($re) {
-            return app('json')->success($re['type'] == 'edit' ? 100001 : $re['data']);
+            if ($re['type'] == 'edit') {
+                return app('json')->success(100001);
+            } else {
+                return app('json')->success(100021, $re['data']);
+            }
         } else {
             return app('json')->fail(100005);
         }

+ 7 - 2
crmeb/app/dao/article/ArticleCategoryDao.php

@@ -32,11 +32,15 @@ class ArticleCategoryDao extends BaseDao
     }
 
     /**
-     * 获取文章列表
+     * 获取文章分类列表
      * @param array $where
      * @param int $page
      * @param int $limit
      * @return mixed
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where, int $page = 0, int $limit = 0)
     {
@@ -82,9 +86,10 @@ class ArticleCategoryDao extends BaseDao
      * 添加修改选择上级分类列表
      * @param array $where
      * @return array
+     * @throws \ReflectionException
      */
     public function getMenus(array $where)
     {
-        return $this->search($where)->order('sort desc,id desc')->column('title,pid,id');
+        return $this->search($where)->order('sort desc,id desc')->column('title,pid,id,is_del,status');
     }
 }

+ 4 - 3
crmeb/app/dao/order/StoreOrderDao.php

@@ -497,7 +497,7 @@ class StoreOrderDao extends BaseDao
      */
     public function chartTimePrice($start, $stop)
     {
-        return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
+        return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
             ->where('add_time', '>=', $start)
             ->where('add_time', '<', $stop)
             ->field('sum(pay_price) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
@@ -513,7 +513,7 @@ class StoreOrderDao extends BaseDao
      */
     public function chartTimeNumber($start, $stop)
     {
-        return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
+        return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
             ->where('add_time', '>=', $start)
             ->where('add_time', '<', $stop)
             ->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
@@ -896,7 +896,7 @@ class StoreOrderDao extends BaseDao
      */
     public function seckillPeople($id, $keyword, $page = 0, $limit = 0)
     {
-        return $this->getModel()
+        return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0)
             ->when($id != 0, function ($query) use ($id) {
                 $query->where('seckill_id', $id);
             })->when($keyword != '', function ($query) use ($keyword) {
@@ -904,6 +904,7 @@ class StoreOrderDao extends BaseDao
             })->where('paid', 1)->field([
                 'real_name',
                 'uid',
+                'user_phone',
                 'SUM(total_num) as goods_num',
                 'COUNT(id) as order_num',
                 'SUM(pay_price) as total_price',

+ 8 - 1
crmeb/app/dao/user/UserBrokerageDao.php

@@ -33,6 +33,10 @@ class UserBrokerageDao extends BaseDao
      * @param int $limit
      * @param array $typeWhere
      * @return array
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, array $typeWhere = [])
     {
@@ -68,7 +72,8 @@ class UserBrokerageDao extends BaseDao
      */
     public function brokerageRankList(array $where, int $page = 0, int $limit = 0)
     {
-        return $this->search($where)->field('uid,SUM(IF(pm=1,`number`,-`number`)) as brokerage_price')->with(['user' => function ($query) {
+        //SUM(IF(pm=1,`number`,-`number`))
+        return $this->search($where)->field('uid,SUM(number) as brokerage_price')->with(['user' => function ($query) {
             $query->field('uid,avatar,nickname');
         }])->order('brokerage_price desc')->group('uid')->when($page && $limit, function ($query) use ($page, $limit) {
             $query->page($page, $limit);
@@ -79,6 +84,7 @@ class UserBrokerageDao extends BaseDao
      * 获取某些条件的佣金总数
      * @param array $where
      * @return mixed
+     * @throws \ReflectionException
      */
     public function getBrokerageSumColumn(array $where)
     {
@@ -92,6 +98,7 @@ class UserBrokerageDao extends BaseDao
      * 获取某个账户下的冻结佣金
      * @param int $uid
      * @return float
+     * @throws \ReflectionException
      */
     public function getUserFrozenPrice(int $uid)
     {

+ 3 - 0
crmeb/app/dao/user/UserDao.php

@@ -82,7 +82,9 @@ class UserDao extends BaseDao
 
     /**
      * @param $uid
+     * @param string $field
      * @return \think\Collection
+     * @throws \ReflectionException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
@@ -164,6 +166,7 @@ class UserDao extends BaseDao
             ->order('count desc')
             ->order('t0.uid desc')
             ->where('t1.spread_time', 'BETWEEN', $time)
+            ->where('t0.is_del', 0)
             ->page($page, $limit)
             ->group('t0.uid')
             ->select()->toArray();

+ 1 - 0
crmeb/app/dao/wechat/WechatQrcodeRecordDao.php

@@ -44,6 +44,7 @@ class WechatQrcodeRecordDao extends BaseDao
      * @param $timeType
      * @param $field
      * @param $str
+     * @param string $orderStatus
      * @return mixed
      */
     public function getRecordTrend($qid, $time, $timeType, $field, $str, $orderStatus = '')

+ 4 - 4
crmeb/app/jobs/UnpaidOrderCancelJob.php

@@ -33,7 +33,7 @@ class UnpaidOrderCancelJob extends BaseJobs
     public function doJob($orderId)
     {
         /** @var StoreOrderServices $services */
-        $services  = app()->make(StoreOrderServices::class);
+        $services = app()->make(StoreOrderServices::class);
         $orderInfo = $services->get($orderId);
         if (!$orderInfo) {
             return true;
@@ -49,21 +49,21 @@ class UnpaidOrderCancelJob extends BaseJobs
         }
         /** @var StoreOrderCartInfoServices $cartServices */
         $cartServices = app()->make(StoreOrderCartInfoServices::class);
-        $cartInfo     = $cartServices->getOrderCartInfo($orderId);
+        $cartInfo = $cartServices->getOrderCartInfo($orderId);
         /** @var StoreOrderRefundServices $refundServices */
         $refundServices = app()->make(StoreOrderRefundServices::class);
 
         try {
             $res = $refundServices->transaction(function () use ($orderInfo, $refundServices) {
                 //回退积分和优惠卷
-                $refundServices->integralAndCouponBack($orderInfo);
+                $refundServices->integralAndCouponBack($orderInfo, 'cancel');
                 //回退库存和销量
                 $refundServices->regressionStock($orderInfo);
                 return true;
             });
             if ($res) {
                 $orderInfo->is_del = 1;
-                $orderInfo->mark   = '订单未支付已超过系统预设时间';
+                $orderInfo->mark = '订单未支付已超过系统预设时间';
                 $orderInfo->save();
             }
             return $res;

+ 5 - 4
crmeb/app/listener/notice/NoticeListener.php

@@ -70,6 +70,7 @@ class NoticeListener implements ListenerInterface
                     case 'bind_spread_uid':
                         if (isset($data['spreadUid']) && $data['spreadUid']) {
                             $name = $data['nickname'] ?? '';
+                            crmebLog('绑定推广关系');
                             //站内信
                             $SystemMsg->sendMsg($data['spreadUid'], ['nickname' => $name]);
                             //模板消息公众号模版消息
@@ -354,7 +355,7 @@ class NoticeListener implements ListenerInterface
                         $link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
                         $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]);
+                        $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
                         break;
                     //确认收货给客服
                     case 'send_admin_confirm_take_over':
@@ -371,7 +372,7 @@ class NoticeListener implements ListenerInterface
                         $link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
                         $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch([['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]]);
+                        $EnterpriseWechat->weComSend(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
                         break;
                     //申请退款给客服发消息
                     case 'send_order_apply_refund':
@@ -381,7 +382,7 @@ class NoticeListener implements ListenerInterface
                         //短信
                         $NoticeSms->sendAdminRefund($order);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]);
+                        $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
                         //公众号
                         $storeName = $orderInfoServices->getCarIdByProductTitle((int)$order['id']);
                         $title = '亲,您有个退款订单待处理!';
@@ -394,7 +395,7 @@ class NoticeListener implements ListenerInterface
                         //站内信
                         $SystemMsg->kefuSystemSend($data);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch([$data]);
+                        $EnterpriseWechat->weComSend($data);
                         break;
                 }
 

+ 6 - 4
crmeb/app/listener/order/OrderPaySuccessListener.php

@@ -46,10 +46,12 @@ class OrderPaySuccessListener implements ListenerInterface
             'change_time' => time()
         ]);
 
-        //赠送购买商品优惠券
-        /** @var StoreProductCouponServices $storeProductCouponServices */
-        $storeProductCouponServices = app()->make(StoreProductCouponServices::class);
-        $storeProductCouponServices->giveOrderProductCoupon((int)$orderInfo['uid'], $orderInfo['id']);
+        //赠送购买商品优惠券,仅普通商品订单才会赠送
+        if (!$orderInfo['seckill_id'] && !$orderInfo['bargain_id'] && !$orderInfo['combination_id']) {
+            /** @var StoreProductCouponServices $storeProductCouponServices */
+            $storeProductCouponServices = app()->make(StoreProductCouponServices::class);
+            $storeProductCouponServices->giveOrderProductCoupon((int)$orderInfo['uid'], $orderInfo['id']);
+        }
 
         //修改开票数据支付状态
         $orderInvoiceServices = app()->make(StoreOrderInvoiceServices::class);

+ 0 - 2
crmeb/app/model/system/store/SystemStore.php

@@ -78,6 +78,4 @@ class SystemStore extends BaseModel
             $query->where('id|name|introduction|phone', 'LIKE', "%$value%");
         }
     }
-
-
 }

+ 1 - 1
crmeb/app/model/user/MemberCardBatch.php

@@ -45,7 +45,7 @@ class MemberCardBatch extends BaseModel
     public function searchTitleAttr($query, $value)
     {
         if ($value !== '') {
-            $query->where('title', $value);
+            $query->where('title', 'like', '%' . $value . '%');
         }
     }
 

+ 10 - 0
crmeb/app/model/user/User.php

@@ -440,4 +440,14 @@ class User extends BaseModel
     {
         if ($value !== '') $query->where('is_del', $value);
     }
+
+    /**
+     * 不等于uid搜索器
+     * @param $query
+     * @param $value
+     */
+    public function searchNotUidAttr($query, $value)
+    {
+        if ($value !== '') $query->where('uid', '<>', $value);
+    }
 }

+ 1 - 1
crmeb/app/model/wechat/WechatQrcode.php

@@ -59,7 +59,7 @@ class WechatQrcode extends BaseModel
 
     public function searchNameAttr($query, $value)
     {
-        if ($value != '') $query->where('name', $value);
+        if ($value != '') $query->whereLike('name', '%' . $value . '%');
     }
 
     public function searchIsDelAttr($query, $value)

+ 16 - 19
crmeb/app/services/activity/coupon/StoreCouponIssueServices.php

@@ -123,6 +123,12 @@ class StoreCouponIssueServices extends BaseServices
             $data['is_permanent'] = 1;
             $data['total_count'] = 0;
         }
+
+        if ($data['is_permanent'] != 1 && $data['receive_limit'] > $data['total_count']) {
+            throw new AdminException(500031);
+        }
+
+
         $data['add_time'] = time();
         $res = $this->dao->save($data);
         if (($data['product_id'] !== '' || $data['category_id'] !== '') && $res) {
@@ -259,7 +265,7 @@ class StoreCouponIssueServices extends BaseServices
                     $data['add_time'] = $item['start_use_time'];
                     $data['end_time'] = $item['end_use_time'];
                 }
-                $data['type'] = 'get';
+                $data['type'] = 'send';
                 $issue['uid'] = $uid;
                 $issue['issue_coupon_id'] = $item['id'];
                 $issue['add_time'] = $time;
@@ -359,30 +365,13 @@ class StoreCouponIssueServices extends BaseServices
         $issueCouponInfo = $this->dao->getInfo((int)$id);
         $uid = $user->uid;
         if (!$issueCouponInfo) throw new ApiException(400516);
-        /** @var MemberRightServices $memberRightService */
-        $memberRightService = app()->make(MemberRightServices::class);
-        if ($issueCouponInfo->receive_type == 4 && (!$user->is_money_level || !$memberRightService->getMemberRightStatus("coupon"))) {
-            if (!$user->is_money_level) throw new ApiException(400097);
-            if (!$memberRightService->getMemberRightStatus("coupon")) throw new ApiException(400098);
-        }
         /** @var StoreCouponIssueUserServices $issueUserService */
         $issueUserService = app()->make(StoreCouponIssueUserServices::class);
-        if ($is_receive) {
-            $alreadyReceived = $issueUserService->count(['uid' => $uid, 'issue_coupon_id' => $id]);
-            if ($alreadyReceived >= $issueCouponInfo['receive_limit']) {
-                throw new ApiException(400518);
-            }
-        }
         /** @var StoreCouponUserServices $couponUserService */
         $couponUserService = app()->make(StoreCouponUserServices::class);
-        if ($issueCouponInfo->remain_count <= 0 && !$issueCouponInfo->is_permanent) throw new ApiException(400518);
         $this->transaction(function () use ($issueUserService, $uid, $id, $couponUserService, $issueCouponInfo) {
             $issueUserService->save(['uid' => $uid, 'issue_coupon_id' => $id, 'add_time' => time()]);
-            $couponUserService->addUserCoupon($uid, $issueCouponInfo, "get");
-            if ($issueCouponInfo['total_count'] > 0) {
-                $issueCouponInfo['remain_count'] -= 1;
-                $issueCouponInfo->save();
-            }
+            $couponUserService->addUserCoupon($uid, $issueCouponInfo, "send");
         });
     }
 
@@ -423,6 +412,9 @@ class StoreCouponIssueServices extends BaseServices
      * @param int $uid
      * @param $types
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserCouponList(int $uid, $types)
     {
@@ -506,6 +498,9 @@ class StoreCouponIssueServices extends BaseServices
      * 获取单个优惠券类型
      * @param array $where
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getOne(array $where)
     {
@@ -532,6 +527,8 @@ class StoreCouponIssueServices extends BaseServices
     /**
      * 给会员发放优惠券
      * @param $uid
+     * @param int $couponId
+     * @return bool
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException

+ 2 - 0
crmeb/app/services/activity/coupon/StoreCouponUserServices.php

@@ -170,6 +170,8 @@ class StoreCouponUserServices extends BaseServices
                     $coupon['start_time'] = $coupon['start_time'] ? date('Y/m/d', $coupon['start_time']) : date('Y/m/d', $coupon['add_time']);
                     $coupon['add_time'] = date('Y/m/d', $coupon['add_time']);
                     $coupon['end_time'] = date('Y/m/d', $coupon['end_time']);
+                    $coupon['start_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['start_use_time']) : 0;
+                    $coupon['end_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['end_use_time']) : 0;
                     $coupon['title'] = $coupon['coupon_title'];
                     $coupon['type'] = $coupon['applicable_type'];
                     $coupon['use_min_price'] = floatval($coupon['use_min_price']);

+ 1 - 1
crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php

@@ -45,7 +45,7 @@ class StoreCouponUserUserServices extends BaseServices
         [$page, $limit] = $this->getPageValue();
         $list = $this->dao->sysPage($where, $page, $limit);
         foreach ($list as $k => &$v) {
-            $v['start_time'] = $v['add_time'];
+            $v['start_time'] = $v['start_time'] > 0 ? $v['start_time'] : $v['add_time'];
             if ($v['end_time'] < time() || $v['use_time'] != 0) $v['is_fail'] = 1;
         }
         $count = $this->dao->sysCount($where);

+ 4 - 1
crmeb/app/services/activity/integral/StoreIntegralOrderServices.php

@@ -725,12 +725,15 @@ class StoreIntegralOrderServices extends BaseServices
      * @param int $id
      * @param string $remark
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function remark(int $id, string $remark)
     {
         if (!$remark) throw new AdminException(400106);
         if (!$id) throw new AdminException(100100);
-        if (!$order = $this->services->get($id)) {
+        if (!$order = $this->dao->get($id)) {
            throw new AdminException(100025);
         }
 

+ 4 - 1
crmeb/app/services/activity/live/LiveAnchorServices.php

@@ -92,10 +92,13 @@ class LiveAnchorServices extends BaseServices
      * @param int $id
      * @param array $data
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save(int $id, array $data)
     {
-        $liveAnchor = $this->dao->get(['wechat' => $data['wechat']]);
+        $liveAnchor = $this->dao->get(['wechat' => $data['wechat'], 'is_del' => 0]);
         if (!MiniProgramService::getRoleList(2, 0, 30, $data['wechat'])) {
             throw new AdminException(400426);
         }

+ 4 - 0
crmeb/app/services/activity/live/LiveRoomServices.php

@@ -40,6 +40,10 @@ class LiveRoomServices extends BaseServices
         $where['is_del'] = 0;
         [$page, $limit] = $this->getPageValue();
         $list = $this->dao->getList($where, '*', [], $page, $limit);
+        $liveProductServices = app()->make(LiveRoomGoodsServices::class);
+        foreach ($list as &$item) {
+            $item['product_ids'] = array_column($liveProductServices->selectList(['live_room_id' => $item['id']])->toArray(), 'live_goods_id');
+        }
         $count = $this->dao->count($where);
         return compact('count', 'list');
     }

+ 11 - 7
crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php

@@ -46,6 +46,9 @@ class LuckLotteryRecordServices extends BaseServices
      * 获取抽奖记录列表
      * @param array $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where)
     {
@@ -108,7 +111,11 @@ class LuckLotteryRecordServices extends BaseServices
      * 写入中奖纪录
      * @param int $uid
      * @param array $prize
+     * @param array $userInfo
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function insertPrizeRecord(int $uid, array $prize, array $userInfo = [])
     {
@@ -218,13 +225,6 @@ class LuckLotteryRecordServices extends BaseServices
                         throw new ApiException(410053);
                     }
                     break;
-                case 7:
-                    //TODO 未完善
-                    break;
-                case 8:
-                    break;
-                case 9:
-                    break;
             }
             $this->dao->update($lottery_record_id, $data, 'id');
         });
@@ -272,7 +272,11 @@ class LuckLotteryRecordServices extends BaseServices
     /**
      * 获取中奖记录
      * @param int $uid
+     * @param array $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getRecord(int $uid, $where = [])
     {

+ 11 - 1
crmeb/app/services/activity/lottery/LuckLotteryServices.php

@@ -154,7 +154,6 @@ class LuckLotteryServices extends BaseServices
         }
         $lottery = $lottery->toArray();
         if (isset($lottery['prize']) && $lottery['prize']) {
-            $products = $coupons = [];
             $product_ids = array_unique(array_column($lottery['prize'], 'product_id'));
             $coupon_ids = array_unique(array_column($lottery['prize'], 'coupon_id'));
             /** @var StoreProductServices $productServices */
@@ -173,6 +172,9 @@ class LuckLotteryServices extends BaseServices
                 }
             }
         }
+        foreach ($lottery['user_level'] as &$item) {
+            $item = (int)$item;
+        }
         /** @var UserLabelServices $userLabelServices */
         $userLabelServices = app()->make(UserLabelServices::class);
         $lottery['user_label'] = !empty($lottery['user_label']) ? $userLabelServices->getLabelList(['ids' => $lottery['user_label']], ['id', 'label_name']) : [];
@@ -183,6 +185,9 @@ class LuckLotteryServices extends BaseServices
      * 添加抽奖活动以及奖品
      * @param array $data
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function add(array $data)
     {
@@ -400,6 +405,11 @@ class LuckLotteryServices extends BaseServices
      * 抽奖
      * @param int $uid
      * @param int $lottery_id
+     * @return mixed
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function luckLottery(int $uid, int $lottery_id)
     {

+ 12 - 4
crmeb/app/services/activity/seckill/StoreSeckillServices.php

@@ -362,7 +362,7 @@ class StoreSeckillServices extends BaseServices
             $header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
         }
         $header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
-        $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+        $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
@@ -716,6 +716,9 @@ class StoreSeckillServices extends BaseServices
      * @param $id
      * @param string $field
      * @return array|false|\PDOStatement|string|\think\Model
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getValidProduct($id, $field = '*')
     {
@@ -724,15 +727,19 @@ class StoreSeckillServices extends BaseServices
 
     /**
      * 秒杀统计
+     * @param $id
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function seckillStatistics($id)
     {
         /** @var StoreOrderServices $orderServices */
         $orderServices = app()->make(StoreOrderServices::class);
-        $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1]], 'uid', false);
-        $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id]], 'uid', false);
-        $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'pay_price');
+        $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]]], 'uid', false);
+        $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'uid', false);
+        $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]], ['paid', '=', 1]], 'pay_price');
         $seckillInfo = $this->dao->get($id);
         $pay_rate = $seckillInfo['quota'] . '/' . $seckillInfo['quota_show'];
         return compact('pay_count', 'order_count', 'all_price', 'pay_rate');
@@ -768,6 +775,7 @@ class StoreSeckillServices extends BaseServices
         /** @var StoreOrderServices $orderServices */
         $orderServices = app()->make(StoreOrderServices::class);
         [$page, $limit] = $this->getPageValue();
+        $where['is_del'] = 0;
         $list = $orderServices->seckillOrder($id, $where, $page, $limit);
         $where['seckill_id'] = $id;
         $count = $orderServices->count($where);

+ 6 - 15
crmeb/app/services/article/ArticleCategoryServices.php

@@ -39,23 +39,14 @@ class ArticleCategoryServices extends BaseServices
      * 获取文章分类列表
      * @param array $where
      * @return array
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where)
     {
-        [$page, $limit] = $this->getPageValue();
         $list = $this->dao->getList($where);
-        if (!empty($list) && $where['title'] !== '') {
-            $pids = Arr::getUniqueKey($list, 'pid');
-            $parentList = $this->dao->getList(['id' => $pids]);
-            $list = array_merge($list, $parentList);
-            foreach ($list as $key => $item) {
-                $arr = $item;
-                unset($list[$key]);
-                if (!in_array($arr, $list)) {
-                    $list[] = $arr;
-                }
-            }
-        }
         $list = get_tree_children($list);
         $count = $this->dao->count($where);
         return compact('list', 'count');
@@ -160,10 +151,10 @@ class ArticleCategoryServices extends BaseServices
     /**
      * 树形列表
      * @return array
+     * @throws \ReflectionException
      */
     public function getTreeList()
     {
-        $where['is_show'] = 1;
-        return sort_list_tier($this->dao->getMenus($where));
+        return sort_list_tier($this->dao->getMenus([]));
     }
 }

+ 1 - 1
crmeb/app/services/order/OutStoreOrderServices.php

@@ -225,7 +225,7 @@ class OutStoreOrderServices extends BaseServices
      * @param array $list
      * @return array
      */
-    public function tidyCartList(array $cartInfo, array $list, int $cartId = 0): array
+    public function tidyCartList(array $cartInfo, array $list, $cartId = 0): array
     {
         $list[] = [
             'cart_id' => $cartId,

+ 11 - 6
crmeb/app/services/order/StoreCartServices.php

@@ -232,8 +232,10 @@ class StoreCartServices extends BaseServices
     public function setCart(int $uid, int $product_id, int $cart_num = 1, string $product_attr_unique = '', int $type = 0, bool $new = true, int $combination_id = 0, int $seckill_id = 0, int $bargain_id = 0, int $advance_id = 0)
     {
         if ($cart_num < 1) $cart_num = 1;
-        //检查限购
-        $this->checkLimit($uid, $product_id, $cart_num, $new);
+        if ($type == 0) {
+            //检查限购
+            $this->checkLimit($uid, $product_id, $cart_num, $new);
+        }
         //检测库存限量
         [$attrInfo, $product_attr_unique, $bargainPriceMin, $cart_num, $productInfo] = $this->checkProductStock($uid, $cart_num, $product_attr_unique, $type, $product_id, $seckill_id, $bargain_id, $combination_id, $advance_id);
         if ($new) {
@@ -432,8 +434,10 @@ class StoreCartServices extends BaseServices
      */
     public function setCartNum($uid, $productId, $num, $unique, $type)
     {
-        //检查限购
-        $this->checkLimit($uid, $productId, $num, 0);
+        if ($type == 1) {
+            //检查限购
+            $this->checkLimit($uid, $productId, $num, 0);
+        }
 
         /** @var StoreProductAttrValueServices $attrValueServices */
         $attrValueServices = app()->make(StoreProductAttrValueServices::class);
@@ -677,6 +681,7 @@ class StoreCartServices extends BaseServices
      * @param $num
      * @param $new
      * @return bool
+     * @throws \ReflectionException
      */
     public function checkLimit($uid, $product_id, $num, $new)
     {
@@ -699,8 +704,8 @@ class StoreCartServices extends BaseServices
             }
         } else if ($limitInfo['limit_type'] == 2) {
             $cartNum = $this->dao->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
-            $orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
-            $orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'refund_num');
+            $orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'cart_num');
+            $orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'refund_num');
             $orderNum = $orderPayNum - $orderRefundNum;
             if (($num + $orderNum + $cartNum) > $limitInfo['limit_num']) {
                 throw new ApiException(410240, ['limit' => $limitInfo['limit_num'], 'pay_num' => $orderNum]);

+ 1 - 1
crmeb/app/services/order/StoreOrderCreateServices.php

@@ -798,7 +798,7 @@ class StoreOrderCreateServices extends BaseServices
                 //计算商品金额
                 if (sys_config('user_brokerage_type') == 1) {
                     //按照实际支付价格返佣
-                    $price = bcmul((string)$cart['truePrice'], $cartNum, 4);
+                    $price = bcmul((string)bcadd((string)$cart['truePrice'], (string)$cart['postage_price'], 2), $cartNum, 4);
                 } else {
                     //按照商品价格返佣
                     if (isset($productInfo['attrInfo'])) {

+ 1 - 0
crmeb/app/services/order/StoreOrderDeliveryServices.php

@@ -569,6 +569,7 @@ class StoreOrderDeliveryServices extends BaseServices
     /**
      * 虚拟商品自动发货
      * @param $orderInfo
+     * @throws \ReflectionException
      */
     public function virtualSend($orderInfo)
     {

+ 15 - 6
crmeb/app/services/order/StoreOrderInvoiceServices.php

@@ -36,21 +36,28 @@ class StoreOrderInvoiceServices extends BaseServices
 
     public function chart(array $where)
     {
+        $where['is_pay'] = 1;
         //全部
-        $data['all'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time']]);
+        $data['all'] = (string)$this->dao->count($where);
         //待开
-        $data['noOpened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 1]);
+        $where['type'] = 1;
+        $data['noOpened'] = (string)$this->dao->count($where);
         //已开
-        $data['opened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 2]);
+        $where['type'] = 2;
+        $data['opened'] = (string)$this->dao->count($where);
         //退款
-        $data['refund'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 3]);
+        $where['type'] = 3;
+        $data['refund'] = (string)$this->dao->count($where);
         return $data;
     }
 
     /**
      * 后台获取开票列表
-     * @param $where
+     * @param array $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where)
     {
@@ -155,7 +162,9 @@ class StoreOrderInvoiceServices extends BaseServices
         if (!$orderInvoice) {
             throw new ApiException(100026);
         }
-        $data['invoice_time'] = time();
+        if ($data['is_invoice'] == 1) {
+            $data['invoice_time'] = time();
+        }
         if (!$this->dao->update($id, $data, 'id')) {
             throw new ApiException(100015);
         }

+ 8 - 7
crmeb/app/services/order/StoreOrderRefundServices.php

@@ -426,18 +426,19 @@ class StoreOrderRefundServices extends BaseServices
     /**
      * 回退积分和优惠卷
      * @param $order
+     * @param string $type
      * @return bool
      */
-    public function integralAndCouponBack($order)
+    public function integralAndCouponBack($order, $type = 'refund')
     {
         /** @var StoreOrderStatusServices $statusService */
         $statusService = app()->make(StoreOrderStatusServices::class);
         $res = true;
-        //回退优惠卷 拆分子订单不退优惠券
-        if (!$order['pid'] && $order['coupon_id'] && $order['coupon_price']) {
-            /** @var StoreCouponUserServices $coumonUserServices */
-            $coumonUserServices = app()->make(StoreCouponUserServices::class);
-            $res = $res && $coumonUserServices->recoverCoupon((int)$order['coupon_id']);
+        //取消的订单退回优惠券
+        if ($type == 'cancel' && $order['coupon_id'] && $order['coupon_price']) {
+            /** @var StoreCouponUserServices $couponUserServices */
+            $couponUserServices = app()->make(StoreCouponUserServices::class);
+            $res = $couponUserServices->recoverCoupon((int)$order['coupon_id']);
             $statusService->save([
                 'oid' => $order['id'],
                 'change_type' => 'coupon_back',
@@ -1064,7 +1065,7 @@ class StoreOrderRefundServices extends BaseServices
         if ($list) {
             foreach ($list as &$item) {
                 $item['paid'] = 1;
-                $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i', (int)$item['add_time']) : '';
+                $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i:s', (int)$item['add_time']) : '';
                 $item['cartInfo'] = $item['cart_info'];
                 if (in_array($item['refund_type'], [1, 2, 4, 5])) {
                     $item['refund_status'] = 1;

+ 9 - 20
crmeb/app/services/order/StoreOrderServices.php

@@ -82,6 +82,8 @@ class StoreOrderServices extends BaseServices
     /**
      * 获取列表
      * @param array $where
+     * @param array $field
+     * @param array $with
      * @return array
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
@@ -1855,9 +1857,10 @@ HTML;
 
     /**
      * 删除订单
-     * @param $uni
-     * @param $uid
+     * @param string $uni
+     * @param int $uid
      * @return bool
+     * @throws \Psr\SimpleCache\InvalidArgumentException
      */
     public function removeOrder(string $uni, int $uid)
     {
@@ -1879,21 +1882,6 @@ HTML;
             'change_time' => time()
         ]);
         if ($order->save() && $res) {
-            //未支付和已退款的状态下才可以退积分退库存退优惠券
-            if ($order['_status']['_type'] == 0 || $order['_status']['_type'] == -2) {
-                /** @var StoreOrderRefundServices $refundServices */
-                $refundServices = app()->make(StoreOrderRefundServices::class);
-                $this->transaction(function () use ($order, $refundServices) {
-                    //回退积分和优惠卷
-                    $res = $refundServices->integralAndCouponBack($order);
-                    //回退库存
-                    $res = $res && $refundServices->regressionStock($order);
-                    if (!$res) {
-                        throw new ApiException(100020);
-                    }
-                });
-
-            }
             return true;
         } else
             throw new ApiException(100020);
@@ -1924,7 +1912,7 @@ HTML;
         $refundServices = app()->make(StoreOrderRefundServices::class);
 
         $this->transaction(function () use ($refundServices, $order) {
-            $res = $refundServices->integralAndCouponBack($order) && $refundServices->regressionStock($order);
+            $res = $refundServices->integralAndCouponBack($order, 'cancel') && $refundServices->regressionStock($order);
             $order->is_del = 1;
             if (!($res && $order->save())) {
                 throw new ApiException(100020);
@@ -2136,7 +2124,7 @@ HTML;
                 try {
                     $this->transaction(function () use ($order, $refundServices) {
                         //回退积分和优惠卷
-                        $res = $refundServices->integralAndCouponBack($order);
+                        $res = $refundServices->integralAndCouponBack($order, 'cancel');
                         //回退库存和销量
                         $res = $res && $refundServices->regressionStock($order);
                         //修改订单状态
@@ -2351,6 +2339,7 @@ HTML;
             }
         }
         $data['_status'] = $orderInfo['_status'] ?? [];
+        $data['_status']['_is_back'] = $orderInfo['delivery_type'] != 'fictitious' && $orderInfo['virtual_type'] == 0;
         $data['cartInfo'] = $data['cartInfo'] ?? $cartInfo;
         return $data;
     }
@@ -2649,7 +2638,7 @@ HTML;
 
                 $data['pay_price'] = $info['pay_price'];
                 $data['pay_postage'] = $info['pay_postage'];
-                $data['offline_postage'] = sys_config('offline_postage', 0);
+                $data['offline_postage'] = (int)sys_config('offline_postage', 0);
                 $data['invalid_time'] = $time;
 
                 break;

+ 1 - 0
crmeb/app/services/order/StoreOrderSplitServices.php

@@ -160,6 +160,7 @@ class StoreOrderSplitServices extends BaseServices
                             'cart_info' => json_encode($_info),
                         ];
                     }
+                    $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['surplus_num' => 0, 'split_status' => 2]);
                 }
 
                 if ($orderInfo['pid'] > 0 && $key == 'other') {

+ 9 - 3
crmeb/app/services/other/export/ExportServices.php

@@ -306,7 +306,7 @@ class ExportServices extends BaseServices
                     'ot_price' => $item['ot_price'],
                     'quota' => $item['quota'],
                     'start_name' => $item['start_name'],
-                    'activity_time' => date('Y-m-d H:i:s', $item['start_time']) . '至' . date('Y-m-d H:i:s', $item['stop_time']),
+                    'activity_time' => date('Y-m-d', $item['start_time']) . '至' . date('Y-m-d', $item['stop_time']),
                     'add_time' => $item['add_time']
                 ];
                 $export[] = $one_data;
@@ -336,13 +336,19 @@ class ExportServices extends BaseServices
         $filename = $data['title'] . '批次列表_' . date('YmdHis', time());
         $export = $fileKey = [];
         if (!empty($data['data'])) {
+            $userIds = array_column($data['data']->toArray(), 'use_uid');
+            /** @var  UserServices $userService */
+            $userService = app()->make(UserServices::class);
+            $userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
+
+
             $i = 0;
             foreach ($data['data'] as $item) {
                 $one_data = [
                     'card_number' => $item['card_number'],
                     'card_password' => $item['card_password'],
-                    'user_name' => $item['user_name'],
-                    'user_phone' => $item['user_phone'],
+                    'user_name' => $userList[$item['use_uid']]['real_name'] ?: $userList[$item['use_uid']]['nickname'],
+                    'user_phone' => $userList[$item['use_uid']] ? $userList[$item['use_uid']]['phone'] : "",
                     'use_time' => $item['use_time'],
                     'use_uid' => $item['use_uid'] ? '已领取' : '未领取'
                 ];

+ 3 - 0
crmeb/app/services/pay/PayNotifyServices.php

@@ -26,7 +26,10 @@ class PayNotifyServices
     /**
      * 订单支付成功之后
      * @param string|null $order_id 订单id
+     * @param string|null $trade_no
+     * @param string $payType
      * @return bool
+     * @throws \Psr\SimpleCache\InvalidArgumentException
      */
     public function wechatProduct(string $order_id = null, string $trade_no = null, string $payType = PayServices::WEIXIN_PAY)
     {

+ 5 - 1
crmeb/app/services/pay/PayServices.php

@@ -40,6 +40,9 @@ class PayServices
     //好友代付
     const FRIEND = 'friend';
 
+    //银行转账
+    const BANK = 'bank';
+
     //支付方式
     const PAY_TYPE = [
         PayServices::WEIXIN_PAY => '微信支付',
@@ -47,7 +50,8 @@ class PayServices
         PayServices::OFFLINE_PAY => '线下支付',
         PayServices::ALIAPY_PAY => '支付宝',
         PayServices::FRIEND => '好友代付',
-        PayServices::ALLIN_PAY => '通联支付'
+        PayServices::ALLIN_PAY => '通联支付',
+        PayServices::BANK => '银行转账',
     ];
 
     /**

+ 7 - 4
crmeb/app/services/product/product/StoreCategoryServices.php

@@ -107,17 +107,16 @@ class StoreCategoryServices extends BaseServices
 
     /**
      * 设置分类状态
-     * @param $id
-     * @param $is_show
+     * @param int $id
+     * @param int $is_show
      */
     public function setShow(int $id, int $is_show)
     {
         $res = $this->dao->update($id, ['is_show' => $is_show]);
         $res = $res && $this->dao->update($id, ['is_show' => $is_show], 'pid');
+        $this->cacheDriver()->clear();
         if (!$res) {
             throw new AdminException(100005);
-        } else {
-            $this->cacheDriver()->clear();
         }
     }
 
@@ -184,6 +183,10 @@ class StoreCategoryServices extends BaseServices
     /**
      * 保存新增数据
      * @param $data
+     * @return int
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function createData($data)
     {

+ 3 - 0
crmeb/app/services/product/product/StoreProductCouponServices.php

@@ -92,6 +92,9 @@ class StoreProductCouponServices extends BaseServices
      * @param int $uid
      * @param $orderId
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function giveOrderProductCoupon(int $uid, $orderId)
     {

+ 3 - 3
crmeb/app/services/product/product/StoreProductServices.php

@@ -950,7 +950,7 @@ class StoreProductServices extends BaseServices
         }
         $header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
         if ($type == 1) {
-            $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+            $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
             $header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
             $header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
         } elseif ($type == 2) {
@@ -1259,7 +1259,7 @@ class StoreProductServices extends BaseServices
             $page = 1;
             $limit = $num;
         }
-        $list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale']);
+        $list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale,is_vip,vip_price']);
         $list = $this->getActivityList($list);
         return $list;
     }
@@ -1815,7 +1815,7 @@ class StoreProductServices extends BaseServices
             $memberCardService = app()->make(MemberCardServices::class);
             $vipStatus = $memberCardService->isOpenMemberCard('vip_price');
             foreach ($list as &$item) {
-                if (!($vipStatus && $item['is_vip'])) {
+                if (!$this->vipIsOpen(!!$item['is_vip'], $vipStatus)) {
                     $item['vip_price'] = 0;
                 }
             }

+ 3 - 0
crmeb/app/services/statistic/CapitalFlowServices.php

@@ -104,6 +104,9 @@ class CapitalFlowServices extends BaseServices
      * 获取资金流水
      * @param $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getFlowList($where)
     {

+ 3 - 0
crmeb/app/services/user/UserAddressServices.php

@@ -82,6 +82,9 @@ class UserAddressServices extends BaseServices
      * @param int $uid
      * @param string $field
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserDefaultAddress(int $uid, string $field = '*')
     {

+ 15 - 2
crmeb/app/services/user/UserBrokerageServices.php

@@ -187,6 +187,7 @@ class UserBrokerageServices extends BaseServices
      * @param array|string[] $type
      * @param string $time
      * @return float
+     * @throws \ReflectionException
      */
     public function getUserBrokerageSum(int $uid, array $type = ['one_brokerage', 'two_brokerage', 'brokerage_user'], $time = '')
     {
@@ -271,7 +272,7 @@ class UserBrokerageServices extends BaseServices
      */
     public function brokerageRankList(string $time = 'week')
     {
-        $where = [];
+        $where = ['pm' => 1];
         if ($time) {
             $where['time'] = $time;
         }
@@ -296,10 +297,14 @@ class UserBrokerageServices extends BaseServices
      * 获取用户排名
      * @param int $uid
      * @param string $time
+     * @return false|int|string
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserBrokerageRank(int $uid, string $time = 'week')
     {
-        $where = [];
+        $where = ['pm' => 1];
         if ($time) {
             $where['time'] = $time;
         }
@@ -327,6 +332,9 @@ class UserBrokerageServices extends BaseServices
      * 推广数据    昨天的佣金   累计提现金额  当前佣金
      * @param int $uid
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function commission(int $uid)
     {
@@ -354,6 +362,7 @@ class UserBrokerageServices extends BaseServices
      * @param array $where
      * @param int $time
      * @return mixed
+     * @throws \ReflectionException
      */
     public function getUsersBokerageSum(array $where, $time = 0)
     {
@@ -372,6 +381,10 @@ class UserBrokerageServices extends BaseServices
      * @param $uid
      * @param $type
      * @return array
+     * @throws \ReflectionException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getBrokerageList($uid, $type)
     {

+ 1 - 0
crmeb/app/services/user/UserCancelServices.php

@@ -32,6 +32,7 @@ class UserCancelServices extends BaseServices
         /** @var WechatUserServices $wechatUserServices */
         $wechatUserServices = app()->make(WechatUserServices::class);
         $userServices->update($uid, ['is_del' => 1]);
+        $userServices->update(['spread_uid' => $uid], ['spread_uid' => 0, 'spread_time' => 0]);
         $wechatUserServices->update(['uid' => $uid], ['is_del' => 1]);
     }
 

+ 12 - 7
crmeb/app/services/user/UserExtractServices.php

@@ -148,11 +148,12 @@ class UserExtractServices extends BaseServices
 
     /**
      * 通过提现申请
-     * @param $id
+     * @param int $id
+     * @param $userExtract
      * @return bool
      * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
      */
     public function changeSuccess(int $id, $userExtract)
     {
@@ -164,11 +165,7 @@ class UserExtractServices extends BaseServices
         $userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type');
         $nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname');
         $phone = $userServices->value(['uid' => $userExtract['uid']], 'phone');
-        event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
 
-        if (!$this->dao->update($id, ['status' => 1])) {
-            throw new AdminException(100007);
-        }
         switch ($userExtract['extract_type']) {
             case 'bank':
                 $order_id = $userExtract['bank_code'];
@@ -246,6 +243,12 @@ class UserExtractServices extends BaseServices
             'nickname' => $insertData['nickname'],
             'phone' => $insertData['phone']
         ], 'extract');
+
+        if (!$this->dao->update($id, ['status' => 1])) {
+            throw new AdminException(100007);
+        }
+        event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
+
         return true;
     }
 
@@ -339,8 +342,10 @@ class UserExtractServices extends BaseServices
 
     /**
      * 通过
-     * @param $id
+     * @param int $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function adopt(int $id)
     {

+ 3 - 1
crmeb/app/services/user/UserLabelRelationServices.php

@@ -47,8 +47,10 @@ class UserLabelRelationServices extends BaseServices
 
     /**
      * 用户设置标签
-     * @param int $uid
+     * @param $uids
      * @param array $labels
+     * @return bool
+     * @throws \Exception
      */
     public function setUserLable($uids, array $labels)
     {

+ 11 - 2
crmeb/app/services/user/UserLabelServices.php

@@ -40,6 +40,9 @@ class UserLabelServices extends BaseServices
      * 获取某一本标签
      * @param $id
      * @return array|\think\Model|null
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getLable($id)
     {
@@ -110,6 +113,9 @@ class UserLabelServices extends BaseServices
      * @param int $id
      * @param array $data
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save(int $id, array $data)
     {
@@ -144,8 +150,11 @@ class UserLabelServices extends BaseServices
 
     /**
      * 删除
-     * @param $id
-     * @throws \Exception
+     * @param int $id
+     * @return bool
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function delLabel(int $id)
     {

+ 41 - 17
crmeb/app/services/user/UserRechargeServices.php

@@ -104,11 +104,8 @@ class UserRechargeServices extends BaseServices
 
         foreach ($list as &$item) {
             switch ($item['recharge_type']) {
-                case 'routine':
-                    $item['_recharge_type'] = '小程序充值';
-                    break;
                 case PayServices::WEIXIN_PAY:
-                    $item['_recharge_type'] = '公众号充值';
+                    $item['_recharge_type'] = '微信充值';
                     break;
                 case 'system':
                     $item['_recharge_type'] = '系统充值';
@@ -138,8 +135,8 @@ class UserRechargeServices extends BaseServices
         $data = [];
         $data['sumPrice'] = $this->getRechargeSum($where, 'price');
         $data['sumRefundPrice'] = $this->getRechargeSum($where, 'refund_price');
-        $where['recharge_type'] = 'routine';
-        $data['sumRoutinePrice'] = $this->getRechargeSum($where, 'price');
+        $where['recharge_type'] = 'alipay';
+        $data['sumAlipayPrice'] = $this->getRechargeSum($where, 'price');
         $where['recharge_type'] = 'weixin';
         $data['sumWeixinPrice'] = $this->getRechargeSum($where, 'price');
         return [
@@ -158,14 +155,14 @@ class UserRechargeServices extends BaseServices
                 'col' => 6,
             ],
             [
-                'name' => '小程序充值金额',
+                'name' => '支付宝充值金额',
                 'field' => '元',
-                'count' => $data['sumRoutinePrice'],
+                'count' => $data['sumAlipayPrice'],
                 'className' => 'logo-bitcoin',
                 'col' => 6,
             ],
             [
-                'name' => '公众号充值金额',
+                'name' => '微信充值金额',
                 'field' => '元',
                 'count' => $data['sumWeixinPrice'],
                 'className' => 'ios-bicycle',
@@ -174,9 +171,14 @@ class UserRechargeServices extends BaseServices
         ];
     }
 
-    /**退款表单
-     * @param $id
-     * @return mixed|void
+    /**
+     * 退款表单
+     * @param int $id
+     * @return array
+     * @throws \FormBuilder\Exception\FormBuilderException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/03/24
      */
     public function refund_edit(int $id)
     {
@@ -196,15 +198,17 @@ class UserRechargeServices extends BaseServices
         $f = array();
         $f[] = Form::input('order_id', '退款单号', $UserRecharge->getData('order_id'))->disabled(true);
         $f[] = Form::radio('refund_price', '状态', 1)->options([['label' => '本金(扣赠送余额)', 'value' => 1], ['label' => '仅本金', 'value' => 0]]);
-//        $f[] = Form::number('refund_price', '退款金额', (float)$UserRecharge->getData('price'))->precision(2)->min(0)->max($UserRecharge->getData('price'));
         return create_form('编辑', $f, Url::buildUrl('/finance/recharge/' . $id), 'PUT');
     }
 
     /**
      * 退款操作
      * @param int $id
-     * @param $refund_price
+     * @param string $refund_price
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function refund_update(int $id, string $refund_price)
     {
@@ -314,6 +318,9 @@ class UserRechargeServices extends BaseServices
      * @param int $uid
      * @param $price
      * @return bool
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function importNowMoney(int $uid, $price)
     {
@@ -340,7 +347,7 @@ class UserRechargeServices extends BaseServices
         //写入充值记录
         $rechargeInfo = [
             'uid' => $uid,
-            'order_id' => $this->getOrderId(),
+            'order_id' => app()->make(StoreOrderCreateServices::class)->getNewOrderId('cz'),
             'recharge_type' => 'balance',
             'price' => $price,
             'give_price' => 0,
@@ -381,7 +388,15 @@ class UserRechargeServices extends BaseServices
     /**
      * 申请充值
      * @param int $uid
+     * @param $price
+     * @param $recharId
+     * @param $type
+     * @param $from
+     * @param bool $renten
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function recharge(int $uid, $price, $recharId, $type, $from, bool $renten = false)
     {
@@ -437,8 +452,13 @@ class UserRechargeServices extends BaseServices
     }
 
     /**
-     * //TODO用户充值成功后
+     * 用户充值成功后
      * @param $orderId
+     * @param array $other
+     * @return bool
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function rechargeSuccess($orderId, array $other = [])
     {
@@ -475,8 +495,12 @@ class UserRechargeServices extends BaseServices
         return true;
     }
 
-    /**根据查询用户充值金额
+    /**
+     * 根据查询用户充值金额
      * @param array $where
+     * @param string $rechargeSumField
+     * @param string $selectType
+     * @param string $group
      * @return float|int
      */
     public function getRechargeMoneyByWhere(array $where, string $rechargeSumField, string $selectType, string $group = "")

+ 40 - 6
crmeb/app/services/user/UserServices.php

@@ -117,6 +117,7 @@ class UserServices extends BaseServices
      * @param int $spreadUid
      * @param string $userType
      * @return User|\think\Model
+     * @throws Exception
      */
     public function setUserInfo($user, int $spreadUid = 0, string $userType = 'wechat')
     {
@@ -992,9 +993,13 @@ class UserServices extends BaseServices
 
     /**
      * 执行赠送会员等级
-     * @param int $uid
+     * @param int $id
+     * @param int $level_id
      * @return mixed
-     * */
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public function saveGiveLevel(int $id, int $level_id)
     {
         if (!$this->getUserInfo($id)) {
@@ -1039,19 +1044,26 @@ class UserServices extends BaseServices
         $field[] = Form::input('time_diff', '到期时间', $timeDiff)->style(['width' => '200px'])->readonly(true);
         if ($userInfo['is_ever_level'] == 0) {
             $field[] = Form::input('day_diff', '剩余天数', $dayDiff)->style(['width' => '200px'])->readonly(true);
+            $field[] = Form::number('days', '增加时长(天)')->precision(0)->style(['width' => '200px'])->required();
         }
-        $field[] = Form::number('days', '增加时长(天)')->precision(0)->style(['width' => '200px'])->required();
         return create_form('赠送付费会员时长', $field, Url::buildUrl('/user/save_give_level_time/' . $id), 'PUT');
     }
 
     /**
      * 执行赠送付费会员时长
-     * @param int $uid
+     * @param int $id
+     * @param int $days
      * @return mixed
-     * */
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
     public function saveGiveLevelTime(int $id, int $days)
     {
         $userInfo = $this->getUserInfo($id);
+        if ($userInfo->is_ever_level == 1) {
+            return true;
+        }
         if (!$userInfo) {
             throw new AdminException(400214);
         }
@@ -1117,7 +1129,12 @@ class UserServices extends BaseServices
 
     /**
      * 用户详细信息
-     * @param $uid
+     * @param int $uid
+     * @param array $userIfno
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserDetailed(int $uid, $userIfno = [])
     {
@@ -1214,6 +1231,9 @@ class UserServices extends BaseServices
      * 用户详情
      * @param int $uid
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function read(int $uid)
     {
@@ -1222,6 +1242,20 @@ class UserServices extends BaseServices
             throw new AdminException(100026);
         }
         $userInfo['avatar'] = strpos($userInfo['avatar'], 'http') === false ? (sys_config('site_url') . $userInfo['avatar']) : $userInfo['avatar'];
+        $userInfo['overdue_time'] = date('Y-m-d H:i:s', $userInfo['overdue_time']);
+        $userInfo['birthday'] = $userInfo['birthday'] < 0 ? 0 : $userInfo['birthday'];
+        if ($userInfo['addres'] == '') {
+            $defaultAddressInfo = app()->make(UserAddressServices::class)->getUserDefaultAddress($uid);
+            if ($defaultAddressInfo) {
+                $userInfo['addres'] = $defaultAddressInfo['province'] . $defaultAddressInfo['city'] . $defaultAddressInfo['district'] . $defaultAddressInfo['detail'];
+            } else {
+                $userInfo['addres'] = '';
+            }
+        }
+        $userInfo['vip_name'] = app()->make(SystemUserLevelServices::class)->value(['grade' => $userInfo['level']], 'name');
+        $userInfo['group_name'] = app()->make(UserGroupServices::class)->value(['id' => $userInfo['group_id']], 'group_name');
+        $userInfo['spread_uid_nickname'] = $this->dao->value(['uid' => $userInfo['spread_uid']], 'nickname') . '(' . $userInfo['spread_uid'] . ')';
+        $userInfo['label_list'] = implode(',', array_column(app()->make(UserLabelRelationServices::class)->getUserLabelList([$uid]), 'label_name'));
         return [
             'uid' => $uid,
             'userinfo' => $this->getUserDetailed($uid, $userInfo),

+ 4 - 0
crmeb/app/services/user/member/MemberCardBatchServices.php

@@ -32,6 +32,10 @@ class MemberCardBatchServices extends BaseServices
     /**
      * 获取会员卡批次列表
      * @param array $where
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where = [])
     {

+ 8 - 9
crmeb/app/services/user/member/MemberCardServices.php

@@ -49,16 +49,15 @@ class MemberCardServices extends BaseServices
         }
         unset($where['is_use']);
         $list = $this->dao->getSearchList($where, $page, $limit);
-        if ($list) {
-            foreach ($list as $k => $v) {
-                if ($v['use_uid']) {
-                    $user_info = $userService->getUserInfo($v['use_uid'], ['nickname', 'phone', 'real_name']);
-                    $list[$k]['username'] = $user_info['real_name'] ? $user_info['real_name'] : $user_info['nickname'];
-                    $list[$k]['phone'] = $user_info ? $user_info['phone'] : "";
-                }
-                $list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
-                $list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
+        $userIds = array_column($list->toArray(), 'use_uid');
+        $userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
+        foreach ($list as $k => $v) {
+            if ($v['use_uid']) {
+                $list[$k]['username'] = $userList[$v['use_uid']]['real_name'] ?: $userList[$v['use_uid']]['nickname'];
+                $list[$k]['phone'] = $userList[$v['use_uid']] ? $userList[$v['use_uid']]['phone'] : "";
             }
+            $list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
+            $list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
         }
         $count = $this->dao->count($where);
         return compact('list', 'count');

+ 2 - 0
crmeb/app/services/wechat/WechatQrcodeCateServices.php

@@ -69,6 +69,8 @@ class WechatQrcodeCateServices extends BaseServices
      */
     public function delCate($id = 0)
     {
+        $count = app()->make(WechatQrcodeServices::class)->count(['cate_id' => $id]);
+        if ($count) throw new AdminException(400454);
         if (!$id) throw new AdminException(100100);
         $res = $this->dao->update($id, ['is_del' => 1]);
         if (!$res) throw new AdminException(100008);

+ 1 - 1
crmeb/app/services/wechat/WechatQrcodeServices.php

@@ -219,7 +219,7 @@ class WechatQrcodeServices extends BaseServices
      * @param int $isFollow
      * @return mixed
      */
-    public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 0)
+    public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 1)
     {
         $response = $this->transaction(function () use ($qrcodeInfo, $userInfo, $spreadInfo, $isFollow) {
 

+ 0 - 2
crmeb/crmeb/services/AliPayService.php

@@ -13,14 +13,12 @@ namespace crmeb\services;
 
 use Alipay\EasySDK\Payment\Wap\Models\AlipayTradeWapPayResponse;
 use app\services\pay\PayServices;
-use crmeb\utils\Hook;
 use think\facade\Event;
 use think\facade\Log;
 use think\facade\Route as Url;
 use Alipay\EasySDK\Kernel\Config;
 use Alipay\EasySDK\Kernel\Factory;
 use crmeb\exceptions\PayException;
-use app\services\pay\PayNotifyServices;
 use Alipay\EasySDK\Kernel\Util\ResponseChecker;
 
 /**

+ 1 - 4
crmeb/crmeb/services/app/WechatService.php

@@ -12,12 +12,10 @@
 namespace crmeb\services\app;
 
 use app\services\message\wechat\MessageServices;
-use app\services\order\StoreOrderServices;
 use app\services\pay\PayServices;
 use app\services\wechat\WechatMessageServices;
 use app\services\wechat\WechatReplyServices;
 use crmeb\exceptions\AdminException;
-use app\services\pay\PayNotifyServices;
 use crmeb\exceptions\ApiException;
 use crmeb\services\easywechat\Application;
 use EasyWeChat\Message\Article;
@@ -33,7 +31,6 @@ use Symfony\Component\HttpFoundation\Request;
 use think\facade\Event;
 use think\facade\Log;
 use think\Response;
-use crmeb\utils\Hook;
 use think\facade\Cache;
 use crmeb\services\SystemConfigService;
 
@@ -395,7 +392,7 @@ class WechatService
         if ($result->return_code == 'SUCCESS' && $result->result_code != 'FAIL') {
             return true;
         } else {
-            throw new ApiException(410089);
+            throw new ApiException($result->err_code_des ?? 400658);
         }
     }
 

+ 0 - 3
crmeb/crmeb/services/pay/storage/AllinPay.php

@@ -13,14 +13,11 @@
 
 namespace crmeb\services\pay\storage;
 
-
-use app\services\pay\PayNotifyServices;
 use app\services\pay\PayServices;
 use crmeb\exceptions\PayException;
 use crmeb\services\pay\BasePay;
 use crmeb\services\pay\PayInterface;
 use crmeb\services\pay\extend\allinpay\AllinPay as AllinPayService;
-use crmeb\utils\Hook;
 use EasyWeChat\Payment\Order;
 use think\facade\Event;
 

+ 1 - 7
crmeb/crmeb/services/pay/storage/V3WechatPay.php

@@ -13,18 +13,14 @@
 
 namespace crmeb\services\pay\storage;
 
-use app\services\pay\PayNotifyServices;
 use app\services\pay\PayServices;
-use app\services\wechat\WechatMessageServices;
 use crmeb\exceptions\PayException;
 use crmeb\services\app\MiniProgramService;
 use crmeb\services\easywechat\Application;
 use crmeb\services\pay\BasePay;
 use crmeb\services\pay\PayInterface;
-use crmeb\utils\Hook;
 use EasyWeChat\Payment\Order;
 use think\facade\Event;
-use think\facade\Log;
 
 /**
  * Class 微信支付v3
@@ -150,7 +146,7 @@ class V3WechatPay extends BasePay implements PayInterface
      */
     public function merchantPay(string $openid, string $orderId, string $amount, array $options = [])
     {
-        $res = $this->instance->v3pay->setType($options['type'])->batches(
+        return $this->instance->v3pay->setType($options['type'])->batches(
             $orderId,
             $amount,
             $options['batch_name'],
@@ -164,8 +160,6 @@ class V3WechatPay extends BasePay implements PayInterface
                 ]
             ]
         );
-
-        return $res;
     }
 
     /**

+ 2 - 1
template/admin/src/api/order.js

@@ -26,10 +26,11 @@ export function orderList(data) {
  * @description 发票头部统计
  * @param {Object} param data {Object} 传值参数
  */
-export function orderInvoiceChart() {
+export function orderInvoiceChart(data) {
   return request({
     url: 'order/invoice/chart',
     method: 'get',
+    params: data,
   });
 }
 

+ 5 - 0
template/admin/src/components/from/from.vue

@@ -58,6 +58,7 @@ export default {
     return {
       modals: false,
       type: 0,
+      loading: false,
       config: {
         global: {
           upload: {
@@ -83,6 +84,8 @@ export default {
     onSubmit(formData) {
       let datas = {};
       datas = formData;
+      if (this.loading) return;
+      this.loading = true;
       request({
         url: this.FromData.action,
         method: this.FromData.method,
@@ -94,9 +97,11 @@ export default {
           this.modals = false;
           setTimeout(() => {
             this.$emit('submitFail');
+            this.loading = false;
           }, 1000);
         })
         .catch((res) => {
+          this.loading = false;
           this.$Message.error(res.msg);
         });
     },

+ 39 - 3
template/admin/src/components/goodsList/index.vue

@@ -95,6 +95,12 @@ export default {
       type: Boolean,
       default: false,
     },
+    selectIds: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
     datas: {
       type: Object,
       default: function () {
@@ -259,6 +265,7 @@ export default {
     } else {
       this.getList();
     }
+    console.log(this.diy);
   },
   methods: {
     productList() {
@@ -324,7 +331,22 @@ export default {
         }
         changeListApi(this.formValidate)
           .then(async (res) => {
+            console.log(this.selectIds);
+
             let data = res.data;
+            if (this.selectIds.length) {
+              let arr = []
+              this.selectIds.map((item) => {
+                data.list.map((i) => {
+                  if (i.id == item) {
+                    console.log(i);
+                    i._checked = true;
+                    arr.push(i)
+                  }
+                });
+              });
+              this.changeCheckbox(arr)
+            }
             this.tableList = data.list;
             this.total = res.data.count;
             this.loading = false;
@@ -347,9 +369,23 @@ export default {
             data.list.forEach((el) => {
               el.image = el.cover_img;
             });
-            this.tableList = data.list;
-            this.total = res.data.count;
-            this.loading = false;
+
+            console.log(this.selectIds);
+            if (this.selectIds.length) {
+              this.selectIds.map((item) => {
+                data.list.map((i) => {
+                  if (i.id == item) {
+                    console.log(i);
+                    i._checked = true;
+                  }
+                });
+              });
+            }
+            this.$nextTick((e) => {
+              this.tableList = data.list;
+              this.total = res.data.count;
+              this.loading = false;
+            });
           })
           .catch((res) => {
             this.loading = false;

+ 1 - 1
template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less

@@ -7,7 +7,7 @@
   text-align: center;
   // color: #fff;
   cursor: pointer;
-  z-index: 9999;
+  z-index: 99;
   .iconcaidanshouqi {
     .trans;
     vertical-align: top;

+ 1 - 1
template/admin/src/components/main/components/tags-nav/tags-nav.less

@@ -69,7 +69,7 @@
     .scroll-body {
       height: ~'calc(100% - 1px)';
       display: inline-block;
-      padding: 3px 20px 0 20px;
+      padding: 3px 40px 0 20px;
       position: absolute;
       overflow: visible;
       white-space: nowrap;

+ 1 - 1
template/admin/src/pages/app/wechat/reply/follow.vue

@@ -133,7 +133,7 @@
                       </div>
                       <span v-show="formValidate.type === 'image'">文件最大2Mb,支持bmp/png/jpeg/jpg/gif格式</span>
                       <span v-show="formValidate.type === 'voice'"
-                        >文件最大2Mb,支持mp3/wma/wav/amr格式,播放长度不超过60s</span
+                        >文件最大2Mb,支持mp3格式,播放长度不超过60s</span
                       >
                     </FormItem>
                   </Form>

+ 1 - 1
template/admin/src/pages/cms/addArticle/index.vue

@@ -37,7 +37,7 @@
             <FormItem label="文章分类:" label-for="cid" prop="cid">
               <div class="perW90">
                 <Select v-model="formValidate.cid">
-                  <Option v-for="item in treeData" :value="item.id" :key="item.id">{{ item.html + item.title }}</Option>
+                  <Option v-for="item in treeData" :value="item.id" :disabled="item.disabled" :key="item.id">{{ item.html + item.title }}</Option>
                 </Select>
               </div>
             </FormItem>

+ 4 - 4
template/admin/src/pages/kefu/mobile/chat_list.vue

@@ -2,7 +2,7 @@
   <div class="chat-list">
     <div class="head-box">
       <div class="hd">
-        <div class="left-wrapper">
+        <div class="left-wrappers">
           <img v-lazy="kefuInfo.avatar" />
           <div class="info" @click="isOnLine = !isOnLine">
             <div>{{ kefuInfo.nickname }}</div>
@@ -45,7 +45,7 @@
     <div class="list-box" v-if="list.length > 0">
       <vue-scroll ref="vs" :ops="ops" @load-before-deactivate="handleBeforeDeactivate">
         <div class="item" v-for="(item, index) in list" :key="index" @click="goPage(item)">
-          <div class="left-wrapper">
+          <div class="left-wrappers">
             <div class="img-box">
               <img v-lazy="item.avatar" />
               <div class="online" :class="{ on: item.online }"></div>
@@ -351,7 +351,7 @@ export default {
             padding: 0 .3rem;
             background: linear-gradient(90deg, #3875EA 0%, #1890FC 100%);
 
-            .left-wrapper {
+            .left-wrappers {
                 position: relative;
                 display: flex;
                 align-items: center;
@@ -488,7 +488,7 @@ export default {
             padding: .23rem .3rem;
             height: 1.5rem;
 
-            .left-wrapper {
+            .left-wrappers {
                 display: flex;
                 align-items: center;
                 .img-box{

+ 1 - 1
template/admin/src/pages/kefu/pc/components/rightMenu.vue

@@ -147,7 +147,7 @@
                   <Button
                     class="btn"
                     type="primary"
-                    v-if="item._status._type == 1 && item._status._type != 0"
+                    v-if="item._status._type == 1 && item._status._type != 0 && item.shipping_type != 2"
                     @click.stop="openDelivery(item)"
                     >发货</Button
                   >

+ 25 - 7
template/admin/src/pages/marketing/channelCode/channelCodeIndex.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <Row class="ivu-mt box-wrapper">
+    <Row class="ivu-mt box-wrapper" ref="warpper">
       <Col span="3" class="left-wrapper">
         <Menu :theme="theme3" :active-name="sortName" width="auto">
           <MenuGroup>
@@ -86,7 +86,11 @@
             </template>
             <template slot-scope="{ row, index }" slot="add_time">
               <span v-if="row.stop === 0"> 永久 </span>
-              <span v-if="row.stop === 1"> {{ row.add_time }} - {{ row.end_time }}</span>
+              <span v-if="row.stop === 1">
+                <div>{{ row.add_time }}</div>
+                <div>-</div>
+                <div>{{ row.end_time }}</div>
+              </span>
               <span v-if="row.stop === -1">已过期</span>
             </template>
             <template slot-scope="{ row, index }" slot="status">
@@ -167,6 +171,8 @@ import {
   wechatQrcodeStatusApi,
   getUserList,
 } from '@/api/setting';
+import { scrollTop } from '@/libs/util';
+
 export default {
   name: 'index',
   filters: {
@@ -256,31 +262,36 @@ export default {
           title: '二维码',
           slot: 'image',
           width: 80,
+          align: 'center',
         },
         {
           title: '二维码名称',
           key: 'name',
-          minWidth: 120,
+          minWidth: 80,
+          align: 'center',
         },
         {
           title: '总关注数',
           key: 'follow',
-          minWidth: 120,
+          minWidth: 80,
+          align: 'center',
         },
         {
           title: '昨日新增关注',
           key: 'y_follow',
-          minWidth: 120,
+          minWidth: 80,
+          align: 'center',
         },
         {
           title: '用户标签',
           slot: 'label_name',
-          minWidth: 60,
+          minWidth: 80,
         },
         {
           title: '时间',
           slot: 'add_time',
-          minWidth: 120,
+          width: 140,
+          align: 'center',
         },
         {
           title: '关联推广员',
@@ -291,6 +302,7 @@ export default {
           title: '状态',
           slot: 'status',
           minWidth: 60,
+          align: 'center',
         },
         {
           title: '操作',
@@ -316,7 +328,12 @@ export default {
   },
   activated() {
     this.getUserLabelAll();
+    this.$nextTick(() => {
+      let scrollElem = document.querySelector('.content-wrapper');
+      scrollElem.scrollTo({ top: 0, behavior: 'smooth' });
+    });
   },
+  mounted() {},
   methods: {
     changeMenu(row, name) {
       this.orderId = row.id;
@@ -349,6 +366,7 @@ export default {
         canvas.height = image.height;
         var context = canvas.getContext('2d');
         context.drawImage(image, 0, 0, image.width, image.height);
+
         var url = canvas.toDataURL(); //得到图片的base64编码数据
         var a = document.createElement('a'); // 生成一个a元素
         var event = new MouseEvent('click'); // 创建一个单击事件

+ 3 - 2
template/admin/src/pages/marketing/channelCode/createCode.vue

@@ -135,7 +135,7 @@
                   </Upload>
                 </div>
                 <span v-show="formData.type === 'image'">文件最大2Mb,支持bmp/png/jpeg/jpg/gif格式</span>
-                <span v-show="formData.type === 'voice'">文件最大2Mb,支持mp3/wma/wav/amr格式,播放长度不超过60s</span>
+                <span v-show="formData.type === 'voice'">文件最大2Mb,支持mp3格式,播放长度不超过60s</span>
               </FormItem>
             </Col>
           </Row>
@@ -502,10 +502,11 @@ export default {
 }
 
 textarea {
-  padding: 5px;
+  padding: 0 5px;
   border-radius: 3px;
   border-color: #c5c8ce;
   outline-color: #2d8cf0;
+  font-size: 14px;
 }
 
 .picBox {

+ 60 - 40
template/admin/src/pages/marketing/live/add_goods.vue

@@ -5,7 +5,7 @@
         <span>
           <Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
         </span>
-        <Divider type="vertical"/>
+        <Divider type="vertical" />
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
       </div>
     </div>
@@ -24,9 +24,9 @@
               <div class="box">
                 <div class="box-item" v-for="(item, index) in goodsList" :key="index">
                   <img :src="item.image" alt="" />
-                  <Icon type="ios-close-circle" size="20" @click="bindDelete(index)" />
+                  <Icon type="ios-close-circle" size="20" @click="bindDelete(index,item)" />
                 </div>
-                <div class="upload-box" @click="modals = true">
+                <div class="upload-box" @click="selectGoods">
                   <Icon type="ios-camera-outline" size="36" />
                 </div>
               </div>
@@ -66,7 +66,13 @@
       </div>
     </Card>
     <Modal v-model="modals" title="商品列表" class="paymentFooter" scrollable width="900" :footer-hide="true">
-      <goods-list ref="goodslist" @getProductId="getProductId" v-if="modals" :ischeckbox="true"></goods-list>
+      <goods-list
+        ref="goodslist"
+        :selectIds="selectIds"
+        @getProductId="getProductId"
+        v-if="modals"
+        :ischeckbox="true"
+      ></goods-list>
     </Modal>
   </div>
 </template>
@@ -100,40 +106,41 @@ export default {
       columns1: [
         { key: 'id', title: '商品ID' },
         { slot: 'img', title: '商品信息' },
-        {
-          key: 'price',
-          title: '直播售价',
-          render: (h, params) => {
-            return h('Input', {
-              props: {
-                type: 'number',
-                value: params.row.price,
-              },
-              on: {
-                input: (val) => {
-                  this.tabList[params.index].price = val;
-                },
-              },
-            });
-          },
-        },
-        {
-          key: 'cost_price',
-          title: '直播原价',
-          render: (h, params) => {
-            return h('Input', {
-              props: {
-                type: 'number',
-                value: params.row.cost_price,
-              },
-              on: {
-                input: (val) => {
-                  this.tabList[params.index].cost_price = val;
-                },
-              },
-            });
-          },
-        },
+        { key: 'price', title: '直播售价' },
+        // {
+        //   key: 'price',
+        //   title: '直播售价',
+        //   render: (h, params) => {
+        //     return h('Input', {
+        //       props: {
+        //         type: 'number',
+        //         value: params.row.price,
+        //       },
+        //       on: {
+        //         input: (val) => {
+        //           this.tabList[params.index].price = val;
+        //         },
+        //       },
+        //     });
+        //   },
+        // },
+        // {
+        //   key: 'cost_price',
+        //   title: '直播原价',
+        //   render: (h, params) => {
+        //     return h('Input', {
+        //       props: {
+        //         type: 'number',
+        //         value: params.row.cost_price,
+        //       },
+        //       on: {
+        //         input: (val) => {
+        //           this.tabList[params.index].cost_price = val;
+        //         },
+        //       },
+        //     });
+        //   },
+        // },
         { key: 'stock', title: '库存' },
         { slot: 'action', fixed: 'right', title: '操作' },
       ],
@@ -143,6 +150,13 @@ export default {
     };
   },
   methods: {
+    selectGoods() {
+      this.modals = true;
+      this.selectIds = this.goodsList.map((i) => {
+        return i.product_id;
+      });
+      console.log(this.selectIds,this.goodsList)
+    },
     // 生成直播商品
     liveGoods() {
       let array = [];
@@ -161,18 +175,24 @@ export default {
         });
     },
     getProductId(data) {
-      this.goodsList = this.goodsList.concat(data);
+      this.goodsList = data;
       this.$nextTick((res) => {
         setTimeout(() => {
           this.modals = false;
         }, 300);
       });
     },
-    bindDelete(index) {
+    bindDelete(index,item) {
       this.goodsList.splice(index, 1);
+      if (this.tabList.length) {
+        let i = this.tabList.findIndex((e) => e.id == item.product_id);
+        this.tabList.splice(i, 1);
+      }
     },
     del(row, index) {
       this.tabList.splice(index, 1);
+      let i = this.goodsList.findIndex((e) => e.product_id == row.id);
+      this.goodsList.splice(i, 1);
     },
     // 提交
     bindSub() {

+ 7 - 3
template/admin/src/pages/marketing/live/anchor.vue

@@ -26,7 +26,7 @@
         <template slot-scope="{ row, index }" slot="action">
           <a @click="edit(row.id)">修改</a>
           <Divider type="vertical" />
-          <a @click="del(row, '删除分组', index)">删除</a>
+          <a @click="del(row, '删除主播', index)">删除</a>
         </template>
       </Table>
       <div class="acea-row row-right page">
@@ -122,8 +122,12 @@ export default {
         .then((res) => {
           this.$Message.success(res.msg);
           this.labelLists.splice(num, 1);
-
-          this.getList();
+          if (!this.labelLists.length && this.labelFrom.page != 1) {
+            this.labelFrom.page -= 1;
+            this.getList();
+          } else {
+            this.getList();
+          }
         })
         .catch((res) => {
           this.$Message.error(res.msg);

+ 5 - 4
template/admin/src/pages/marketing/live/components/live_detail.vue

@@ -12,7 +12,8 @@
         </div>
         <div class="list sp">
           <label class="name">直播间ID:</label>
-          <span class="info">{{ FormData.room_id }}</span>
+          <span class="info">{{ FormData.id }}</span>
+          <span class="info">(微信直播间ID:{{ FormData.room_id }})</span>
         </div>
         <div class="list sp">
           <label class="name">主播昵称:</label>
@@ -51,15 +52,15 @@
           <img style="max-width: 150px; height: 80px" :src="FormData.share_img" />
         </div>
         <div class="list sp">
-          <label class="name">是否关闭点赞:</label>
+          <label class="name">是否开启点赞:</label>
           <span class="info blue">{{ FormData.close_like | filterClose }}</span>
         </div>
         <div class="list sp">
-          <label class="name">是否关闭货架:</label>
+          <label class="name">是否开启货架:</label>
           <span class="info blue">{{ FormData.close_goods | filterClose }}</span>
         </div>
         <div class="list sp">
-          <label class="name">是否关闭评论:</label>
+          <label class="name">是否开启评论:</label>
           <span class="info blue">{{ FormData.close_comment | filterClose }}</span>
         </div>
 

+ 10 - 5
template/admin/src/pages/marketing/live/creat_live.vue

@@ -5,7 +5,7 @@
         <span>
           <Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
         </span>
-        <Divider type="vertical"/>
+        <Divider type="vertical" />
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
       </div>
     </div>
@@ -16,6 +16,7 @@
         :label-width="labelWidth"
         :label-position="labelPosition"
         class="tabform"
+        :rules="ruleValidate"
         @submit.native.prevent
       >
         <Col span="24">
@@ -26,7 +27,7 @@
           >
         </Col>
         <Col span="24">
-          <FormItem label="选择主播:">
+          <FormItem label="选择主播:" prop="anchor_wechat">
             <Select
               v-model="formValidate.anchor_wechat"
               filterable
@@ -40,7 +41,7 @@
         </Col>
         <Row :gutter="24" type="flex">
           <Col span="24">
-            <FormItem label="直播间名称:">
+            <FormItem label="直播间名称:" prop="name">
               <Input
                 enter-button
                 placeholder="请输入直播间名称"
@@ -52,7 +53,7 @@
           </Col>
           <Col span="24">
             <div style="display: flex">
-              <FormItem label="背景图:">
+              <FormItem label="背景图:" prop="name">
                 <div @click="modalPicTap(0)" class="box">
                   <img :src="formValidate.cover_img" alt="" v-if="formValidate.cover_img" />
                   <div class="upload-box" v-else>
@@ -93,7 +94,7 @@
             </FormItem>
           </Col>
           <Col span="24">
-            <FormItem label="直播时间:">
+            <FormItem label="直播时间:" prop="name">
               <DatePicker
                 type="datetimerange"
                 format="yyyy-MM-dd HH:mm"
@@ -322,6 +323,10 @@ export default {
       activeIndex: 0,
       liveList: [],
       modal3: false,
+      ruleValidate: {
+        anchor_wechat: [{ required: true, message: 'Please select the city', trigger: 'change' }],
+        name: [{ required: true, message: 'The name cannot be empty', trigger: 'blur' }],
+      },
     };
   },
   mounted() {

+ 5 - 2
template/admin/src/pages/marketing/live/index.vue

@@ -79,8 +79,8 @@
           <a @click="detail(row, '详情')">详情</a>
           <Divider type="vertical" />
           <a @click="del(row, '删除这条信息', index)">删除</a>
-          <Divider type="vertical" />
-          <a @click="addGoods(row)">添加商品</a>
+          <Divider type="vertical" v-if="row.live_status == 102" />
+          <a v-if="row.live_status == 102" @click="addGoods(row)">添加商品</a>
         </template>
       </Table>
       <div class="acea-row row-right page">
@@ -105,6 +105,7 @@
         ref="goodslist"
         @getProductId="getProductId"
         v-if="isShowBox"
+        :selectIds="selectIds"
         :ischeckbox="true"
         :liveStatus="true"
       ></goods-list>
@@ -179,6 +180,7 @@ export default {
       tabList: [],
       loading: false,
       activeItem: {},
+      selectIds: [],
     };
   },
   computed: {
@@ -236,6 +238,7 @@ export default {
     },
     // 直播间添加商品
     addGoods(row) {
+      this.selectIds = row.product_ids;
       this.activeItem = row;
       this.isShowBox = true;
     },

+ 2 - 2
template/admin/src/pages/marketing/live/live_goods.vue

@@ -38,14 +38,14 @@
             <Button v-auth="['setting-system_menus-add']" type="primary" @click="menusAdd('添加直播间')" icon="md-add"
               >添加商品
             </Button>
-            <Button
+            <!-- <Button
               v-auth="['setting-system_menus-add']"
               icon="md-list"
               type="success"
               @click="syncGoods"
               style="margin-left: 20px"
               >同步商品
-            </Button>
+            </Button> -->
           </Col>
         </Row>
       </Form>

+ 6 - 5
template/admin/src/pages/marketing/point_record/index.vue

@@ -9,32 +9,33 @@
         @submit.native.prevent
       >
         <Row :gutter="24" type="flex">
-          <Col span="24">
+          <Col span="6">
             <FormItem label="订单时间:">
               <!-- <dateRadio @selectDate="onSelectDate"></dateRadio> -->
               <DatePicker
                 :editable="false"
-                :clearable="false"
                 @on-change="onchangeTime"
                 :value="timeVal"
                 format="yyyy/MM/dd"
                 type="daterange"
                 placement="bottom-start"
                 placeholder="请选择时间"
-                style="width: 200px"
+                style="width: 100%"
                 :options="options"
+                clearable
                 class="mr20"
               ></DatePicker>
             </FormItem>
           </Col>
-          <Col span="24">
+          <Col span="6">
             <FormItem label="交易类型:">
               <Select
                 type="button"
                 v-model="formValidate.trading_type"
                 class="mr15"
                 @on-change="selChange"
-                style="width: 30%"
+                style="width: 100%"
+                clearable
               >
                 <Option
                   :label="item"

+ 12 - 2
template/admin/src/pages/marketing/storeBargain/create.vue

@@ -295,7 +295,7 @@
                 </FormItem>
               </Col>
             </Row>
-            <div v-show="current === 2">
+            <div v-if="current === 2">
               <FormItem label="内容:">
                 <WangEditor
                   style="width: 90%"
@@ -304,7 +304,7 @@
                 ></WangEditor>
               </FormItem>
             </div>
-            <div v-show="current === 3">
+            <div v-if="current === 3">
               <FormItem label="规则:">
                 <WangEditor
                   style="width: 90%"
@@ -789,6 +789,8 @@ export default {
           this.formValidate = info;
           this.formValidate.rule = info.rule === null ? '' : info.rule;
           this.$set(this.formValidate, 'items', info.attrs.items);
+          this.description = this.formValidate.description;
+
           this.columns = info.attrs.header;
           let radio = {
             title: '选择',
@@ -885,6 +887,9 @@ export default {
               }
             }
             this.current += 1;
+            setTimeout((e) => {
+              this.formValidate.description += ' ';
+            }, 0);
           } else {
             return this.$Message.warning('请完善您的信息');
           }
@@ -892,6 +897,11 @@ export default {
       } else {
         if (this.formValidate.image) {
           this.current += 1;
+          if (this.current == 3) {
+            setTimeout((e) => {
+              this.formValidate.rule += ' ';
+            }, 0);
+          }
         } else {
           this.$Message.warning('请选择商品');
         }

+ 1 - 1
template/admin/src/pages/marketing/storeCouponIssue/create.vue

@@ -83,7 +83,7 @@
             @on-change="dateChange"
           ></DatePicker>
         </FormItem>
-        <FormItem label="领取时间">
+        <FormItem label="领取时间" v-if="formData.receive_type != 2 && formData.receive_type != 3">
           <RadioGroup v-model="isReceiveTime">
             <Radio :label="1">限时</Radio>
             <Radio :label="0">不限时</Radio>

+ 6 - 7
template/admin/src/pages/marketing/storeCouponIssue/index.vue

@@ -22,10 +22,9 @@
               <Select v-model="receive_type" placeholder="请选择" clearable @on-change="userSearchs">
                 <Option value="all">全部</Option>
                 <Option value="1">手动领取</Option>
-                <Option value="2">新人券</Option>
-                <Option value="3">赠送券</Option>
-                <Option value="4">会员券</Option>
-                <Option value="5">购买券</Option>
+                <Option value="2">新用户自动发放</Option>
+                <Option value="3">后台赠送</Option>
+                <Option value="4">付费会员专享</Option>
               </Select>
             </FormItem>
           </Col>
@@ -128,9 +127,9 @@
         :columns="columns2"
         :data="receiveList"
         ref="table"
-        class="mt25"
         :loading="loading2"
         highlight-row
+        height="500"
         no-userFrom-text="暂无数据"
         no-filtered-userFrom-text="暂无筛选结果"
       >
@@ -140,9 +139,9 @@
           </div>
         </template>
       </Table>
-      <div class="acea-row row-right page">
+      <!-- <div class="acea-row row-right page">
         <Page :total="total2" show-elevator show-total @on-change="receivePageChange" :page-size="receiveFrom.limit" />
-      </div>
+      </div> -->
     </Modal>
   </div>
 </template>

+ 1 - 1
template/admin/src/pages/marketing/storeCouponUser/index.vue

@@ -42,7 +42,7 @@
           <Icon type="md-close" v-else color="#ed5565" size="14" />
         </template>
         <template slot-scope="{ row, index }" slot="add_time">
-          <span> {{ row.add_time | formatDate }}</span>
+          <span> {{ row.start_time | formatDate }}</span>
         </template>
         <template slot-scope="{ row, index }" slot="end_time">
           <span> {{ row.end_time | formatDate }}</span>

+ 7 - 5
template/admin/src/pages/marketing/storeIntegralOrder/components/tableFrom.vue

@@ -8,10 +8,10 @@
       class="tabform"
       @submit.native.prevent
     >
-      <Row :gutter="24" type="flex" justify="end">
+      <Row :gutter="24">
         <Col span="8" class="ivu-text-left">
           <FormItem label="订单状态:">
-            <RadioGroup v-model="orderData.status" type="button" @on-change="selectChange2(orderData.status)">
+            <RadioGroup v-model="orderData.status" type="button" @on-change="selectChange2(orderData.status)" style="width: 400px">
               <Radio label="">全部 {{ '(' + orderChartType.statusAll ? orderChartType.statusAll : 0 + ')' }}</Radio>
               <Radio label="1">未发货 {{ '(' + orderChartType.unshipped ? orderChartType.unshipped : 0 + ')' }}</Radio>
               <Radio label="2">待收货 {{ '(' + orderChartType.untake ? orderChartType.untake : 0 + ')' }}</Radio>
@@ -35,7 +35,9 @@
             ></DatePicker>
           </FormItem>
         </Col>
-        <Col span="8">
+      </Row>
+      <Row :gutter="24" type="flex">
+        <Col span="12">
           <div class="df">
             <FormItem label="搜索:" prop="real_name" label-for="real_name">
               <Input
@@ -268,7 +270,7 @@ export default {
   },
   watch: {
     $route() {
-      if (this.$route.fullPath === (this.$routeProStr + '/order/list?status=1')) {
+      if (this.$route.fullPath === this.$routeProStr + '/order/list?status=1') {
         this.getPath();
       }
     },
@@ -276,7 +278,7 @@ export default {
   created() {
     // this.timeVal = this.today;
     // this.orderData.data = this.timeVal.join('-');
-    if (this.$route.fullPath === (this.$routeProStr + '/order/list?status=1')) {
+    if (this.$route.fullPath === this.$routeProStr + '/order/list?status=1') {
       this.getPath();
     }
     // this.getToken();

+ 9 - 8
template/admin/src/pages/marketing/storeSeckill/create.vue

@@ -5,7 +5,7 @@
         <span>
           <Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
         </span>
-        <Divider type="vertical"/>
+        <Divider type="vertical" />
         <span class="ivu-page-header-title">{{ $route.params.id ? '编辑秒杀商品' : '添加秒杀商品' }}</span>
       </div>
     </div>
@@ -267,7 +267,7 @@
               <Col span="24">
                 <FormItem label="规格选择:">
                   <Table :data="specsData" :columns="columns" border @on-selection-change="changeCheckbox">
-                    <template slot-scope="{ row, index }" slot="price">
+                    <!-- <template slot-scope="{ row, index }" slot="price">
                       <InputNumber
                         v-model="row.price"
                         :min="0.01"
@@ -280,7 +280,7 @@
                         "
                         :active-change="false"
                       ></InputNumber>
-                    </template>
+                    </template> -->
                     <template slot-scope="{ row, index }" slot="pic">
                       <div
                         class="acea-row row-middle row-center-wrapper"
@@ -630,18 +630,19 @@ export default {
           title: title,
           key: key,
           align: 'center',
-          minWidth: 100,
+          minWidth: 120,
           render: (h, params) => {
             return h('div', [
               h('InputNumber', {
                 props: {
-                  min: 1,
-                  precision: 0,
-                  value: params.row.quota,
+                  min: 0,
+                  value: key === 'price' ? params.row.price : params.row.quota,
+                  formatter: (value) =>
+                    key === 'price' ? `${value}`.match(/^\d+(?:\.\d{0,2})?/) : `${value}`.match(/^\d+(?:\.\d{0,-1})?/),
                 },
                 on: {
                   'on-change': (e) => {
-                    params.row.quota = e;
+                    key === 'price' ? (params.row.price = e) : (params.row.quota = e);
                     that.specsData[params.index] = params.row;
                     if (!!that.formValidate.attrs && that.formValidate.attrs.length) {
                       that.formValidate.attrs.forEach((v, index) => {

+ 8 - 5
template/admin/src/pages/marketing/storeSeckill/statistics.vue

@@ -5,7 +5,7 @@
         <span>
           <Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
         </span>
-        <Divider type="vertical"/>
+        <Divider type="vertical" />
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
       </div>
     </div>
@@ -26,8 +26,7 @@
         <Row type="flex" :gutter="24">
           <Col span="6" v-if="type == 1">
             <FormItem label="订单状态:" label-for="status">
-              <Select v-model="pagination.status" placeholder="请选择订单状态">
-                <Option value="">全部</Option>
+              <Select v-model="pagination.status" clearable placeholder="请选择订单状态" @on-change="changeStatus">
                 <Option value="0">未支付</Option>
                 <Option value="1">待发货</Option>
                 <Option value="2">待收货</Option>
@@ -199,6 +198,10 @@ export default {
     this.getList(this.id);
   },
   methods: {
+    changeStatus() {
+      this.pagination.page = 1;
+      this.getList(this.id);
+    },
     // 统计
     getStatistics(id) {
       getseckillStatistics(id).then((res) => {
@@ -246,7 +249,7 @@ export default {
 };
 </script>
 
-<style lang='less' scoped>
+<style lang="less" scoped>
 .cl {
   margin-right: 20px;
 }
@@ -261,7 +264,7 @@ export default {
 .ech-box {
   margin-top: 10px;
 }
-/deep/ .ivu-tabs-nav-scroll{
+/deep/ .ivu-tabs-nav-scroll {
   background-color: #fff;
   padding-top: 5px;
 }

+ 9 - 6
template/admin/src/pages/order/invoice/index.vue

@@ -68,7 +68,7 @@
           </Row>
         </Form>
       </div>
-    </card>
+    </Card>
     <Card :bordered="false" dis-hover>
       <Tabs v-model="currentTab" @on-click="onClickTab" v-if="tablists" class="mb20">
         <TabPane :label="'全部发票(' + tablists.all + ')'" name=" " />
@@ -94,7 +94,7 @@
         </template>
         <template slot-scope="{ row, index }" slot="is_invoice">
           <div v-if="row.is_invoice === 1">已开票</div>
-          <div v-else>未开票</div>
+          <div v-else>--</div>
         </template>
         <template slot-scope="{ row, index }" slot="status">
           <div v-if="row.status === 0">未发货</div>
@@ -151,8 +151,8 @@
           <div class="list">
             <div class="title row">联系信息</div>
             <Row class="row">
-              <Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
-              <Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
+              <Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
+              <Col span="12">联系电话: {{ invoiceDetails.drawer_phone }}</Col>
             </Row>
             <Row class="row">
               <Col span="12">联系邮箱: {{ invoiceDetails.email }}</Col>
@@ -178,7 +178,7 @@
           <div class="list">
             <div class="title row">联系信息</div>
             <Row class="row">
-              <Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
+              <Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
               <Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
             </Row>
             <Row class="row">
@@ -502,6 +502,7 @@ export default {
           this.invoiceShow = false;
           this.getList();
           this.empty();
+          this.getTabs();
         })
         .catch((err) => {
           this.$Message.error(err.msg);
@@ -534,7 +535,7 @@ export default {
       this.getList();
     },
     getTabs() {
-      orderInvoiceChart()
+      orderInvoiceChart(this.orderData)
         .then((res) => {
           this.tablists = res.data;
         })
@@ -545,6 +546,7 @@ export default {
     // 精确搜索()
     orderSearch() {
       this.orderData.page = 1;
+      this.getTabs();
       this.getList();
     },
     // 具体日期搜索();
@@ -553,6 +555,7 @@ export default {
       this.timeVal = e;
       this.orderData.data = this.timeVal[0] ? this.timeVal.join('-') : '';
       this.getList();
+      this.getTabs();
     },
     //订单状态搜索()
     selectChange() {

+ 14 - 2
template/admin/src/pages/order/orderList/handle/orderDetails.vue

@@ -15,7 +15,16 @@
         <div class="ivu-description-list-title">订单信息</div>
         <Row class="mb10">
           <Col span="12">订单ID:{{ orderDatalist.orderInfo.order_id }}</Col>
-          <Col span="12" class="fontColor1">订单状态:{{ orderDatalist.orderInfo._status._title }}</Col>
+          <Col span="12" class="fontColor1"
+            >订单状态:{{ orderDatalist.orderInfo._status._title }}
+            {{
+              orderDatalist.orderInfo.refund.length
+                ? orderDatalist.orderInfo.is_all_refund
+                  ? '退款中'
+                  : '部分退款中'
+                : ''
+            }}
+          </Col>
         </Row>
         <Row class="mb10">
           <Col span="12">商品总数:{{ orderDatalist.orderInfo.total_num }}</Col>
@@ -34,7 +43,10 @@
           <Col span="12">实际支付:{{ orderDatalist.orderInfo.pay_price }}</Col>
         </Row>
         <Row class="mb10">
-          <Col span="12" class="fontColor3 mb10" v-if="parseFloat(orderDatalist.orderInfo.refund_price)"
+          <Col
+            span="12"
+            class="fontColor3 mb10"
+            v-if="parseFloat(orderDatalist.orderInfo.refund_price) && orderDatalist.orderInfo.refund_type != 3"
             >退款金额:{{ parseFloat(orderDatalist.orderInfo.refund_price) }}</Col
           >
           <Col span="12" class="fontColor3 mb10" v-if="parseFloat(orderDatalist.orderInfo.use_integral)"

+ 1 - 1
template/admin/src/pages/order/orderList/handle/orderSend.vue

@@ -190,7 +190,7 @@ export default {
       expressTemp: [],
       deliveryList: [],
       temp: {},
-      export_open: true,
+      export_open: false,
       manyFormValidate: [],
       header: [
         {

+ 0 - 0
template/admin/src/pages/product/productAdd/index.vue


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません