Explorar o código

Merge branch 'dev' into dev-sxb

# Conflicts:
#	app/common/dao/user/UserDao.php
sunxbiao hai 1 ano
pai
achega
d480fb7ca4

+ 1 - 1
app/command/GreatLifeOrderIndependentAccount.php

@@ -42,7 +42,7 @@ class GreatLifeOrderIndependentAccount extends Command
42 42
         $merchants = [];
43 43
 
44 44
         // 已支付、未结算
45
-        $where = ['paid' => 1, 'is_independentaccount' => 0, 'is_del' => 0, 'is_system_del' => 0, 'is_settlement' => 1];
45
+        $where = ['paid' => 1, 'is_independentaccount' => 0, 'is_del' => 0, 'is_system_del' => 0];
46 46
         // 订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付 6已取消'
47 47
         $status = [2, 3];
48 48
         // 普通订单

+ 1 - 1
app/command/HuafeiOrderIndependentAccount.php

@@ -53,7 +53,7 @@ class HuafeiOrderIndependentAccount extends Command
53 53
         // 订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付 6已取消'
54 54
         $status = [2];
55 55
         // 普通订单
56
-        $cursor = Db::table('rrx_order_huafei')->where('is_independentaccount', 0)->where('gzc',1)->whereIn('status', $status)->select();
56
+        $cursor = Db::table('rrx_order_huafei')->where('is_independentaccount', 0)->whereIn('status', $status)->select();
57 57
 
58 58
 
59 59
         /** @var StoreOrderRepository $storeOrderRepository */

+ 28 - 0
app/common/dao/user/UserDao.php

@@ -383,6 +383,34 @@ class UserDao extends BaseDao
383 383
     }
384 384
 
385 385
     /**
386
+     * 获取测试用户 uid List
387
+     * @return array
388
+     */
389
+    public function getTestUidList(): array
390
+    {
391
+        return $this::getModel()::getDB()->where('test_user', '=', 1)->column('uid');
392
+    }
393
+
394
+    /**
395
+     * 获取删除用户 uid List
396
+     * @return array
397
+     */
398
+    public function getDelUidList(): array
399
+    {
400
+        return $this::getModel()::getDB()->where('is_del', '=', 1)->column('uid');
401
+    }
402
+
403
+    /**
404
+     * 获取删除用户 uid List
405
+     * @return array
406
+     */
407
+    public function getInvalidUidList(): array
408
+    {
409
+        return $this::getModel()::getDB()->where('test_user', '=', 1)->whereOr('is_del', '=', 1)->column('uid');
410
+    }
411
+
412
+
413
+    /**
386 414
      * @param $uid
387 415
      * @return CommonEntity
388 416
      */

+ 87 - 3
app/common/repositories/finance/FinanceRepository.php

@@ -28,8 +28,17 @@ class FinanceRepository extends BaseRepository
28 28
      */
29 29
     public function order_overview($mer_id = 0)
30 30
     {
31
+        // 需要过滤掉的用户
32
+        /** @var UserRepository $userRepository */
33
+        $userRepository = app()->make(UserRepository::class);
34
+        $invalidUidList = $userRepository->getInvalidUidList();
35
+
31 36
         if ($mer_id) {
32 37
             $where = "mer_id = " . $mer_id . " and paid = 1";
38
+            if (!empty($invalidUidList)) {
39
+                $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
40
+                $where .= $invalidSqlStr;
41
+            }
33 42
             $type = input('type', 1);
34 43
             $day = input('day', '');
35 44
     
@@ -138,8 +147,14 @@ class FinanceRepository extends BaseRepository
138 147
             $weekWhere .= " and DATE(create_time) >= '" . $oneWeekAgoFormatted . "' and DATE(create_time) <= '" . $todayFormatted . "'";
139 148
             //今日时间条件
140 149
             $dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
141
-    
142
-    
150
+
151
+            if (!empty($invalidUidList)) {
152
+                $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
153
+                $where .= $invalidSqlStr;
154
+                $weekWhere .= $invalidSqlStr;
155
+                $dayWhere .= $invalidSqlStr;
156
+            }
157
+
143 158
             // 会员专区订单总数
144 159
             //总数
145 160
             $chengjiaomoney = Db::name('store_order')->where($where)->where('mer_id', 496)->count();
@@ -250,6 +265,15 @@ class FinanceRepository extends BaseRepository
250 265
     public function user_overview($mer_id = 0)
251 266
     {
252 267
         $where = "1=1 ";
268
+
269
+        // 需要过滤掉的用户
270
+        /** @var UserRepository $userRepository */
271
+        $userRepository = app()->make(UserRepository::class);
272
+        $invalidUidList = $userRepository->getInvalidUidList();
273
+        if (!empty($invalidUidList)) {
274
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
275
+            $where .= $invalidSqlStr;
276
+        }
253 277
         if ($mer_id) {
254 278
             $mer_uid = Db::name('merchant')->where('mer_id', $mer_id)->value('uid');
255 279
             $userRepository = app()->make(UserRepository::class);
@@ -368,6 +392,18 @@ class FinanceRepository extends BaseRepository
368 392
         $weekWhere = " 1=1";
369 393
         $dayWhere = " 1=1";
370 394
 
395
+        // 需要过滤掉的用户
396
+        /** @var UserRepository $userRepository */
397
+        $userRepository = app()->make(UserRepository::class);
398
+        $invalidUidList = $userRepository->getInvalidUidList();
399
+        if (!empty($invalidUidList)) {
400
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
401
+            $where .= $invalidSqlStr;
402
+            $sWeekWhere .= $invalidSqlStr;
403
+            $weekWhere .= $invalidSqlStr;
404
+            $dayWhere .= $invalidSqlStr;
405
+        }
406
+
371 407
         $currentDate = date('Y-m-d');
372 408
         // 上周的开始日期(周一)
373 409
         $startDate = date('Y-m-d', strtotime('last Monday', strtotime($currentDate)));
@@ -428,6 +464,18 @@ class FinanceRepository extends BaseRepository
428 464
         $sWeekWhere = " 1=1";
429 465
         $weekWhere = " 1=1";
430 466
         $dayWhere = " 1=1";
467
+
468
+        // 需要过滤掉的用户
469
+        /** @var UserRepository $userRepository */
470
+        $userRepository = app()->make(UserRepository::class);
471
+        $invalidUidList = $userRepository->getInvalidUidList();
472
+        if (!empty($invalidUidList)) {
473
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
474
+            $where .= $invalidSqlStr;
475
+            $sWeekWhere .= $invalidSqlStr;
476
+            $weekWhere .= $invalidSqlStr;
477
+            $dayWhere .= $invalidSqlStr;
478
+        }
431 479
        
432 480
         $currentDate = date('Y-m-d');
433 481
         // 上周的开始日期(周一)
@@ -481,7 +529,19 @@ class FinanceRepository extends BaseRepository
481 529
         $sWeekWhere = " 1=1";
482 530
         $weekWhere = " 1=1";
483 531
         $dayWhere = " 1=1";
484
-       
532
+
533
+        // 需要过滤掉的用户
534
+        /** @var UserRepository $userRepository */
535
+        $userRepository = app()->make(UserRepository::class);
536
+        $invalidUidList = $userRepository->getInvalidUidList();
537
+        if (!empty($invalidUidList)) {
538
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
539
+            $where .= $invalidSqlStr;
540
+            $sWeekWhere .= $invalidSqlStr;
541
+            $weekWhere .= $invalidSqlStr;
542
+            $dayWhere .= $invalidSqlStr;
543
+        }
544
+
485 545
         $currentDate = date('Y-m-d');
486 546
         // 上周的开始日期(周一)
487 547
         $startDate = date('Y-m-d', strtotime('last Monday', strtotime($currentDate)));
@@ -538,6 +598,18 @@ class FinanceRepository extends BaseRepository
538 598
         $sWeekWhere = " 1=1";
539 599
         $weekWhere = " 1=1";
540 600
         $dayWhere = " 1=1";
601
+
602
+        // 需要过滤掉的用户
603
+        /** @var UserRepository $userRepository */
604
+        $userRepository = app()->make(UserRepository::class);
605
+        $invalidUidList = $userRepository->getInvalidUidList();
606
+        if (!empty($invalidUidList)) {
607
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
608
+            $where .= $invalidSqlStr;
609
+            $sWeekWhere .= $invalidSqlStr;
610
+            $weekWhere .= $invalidSqlStr;
611
+            $dayWhere .= $invalidSqlStr;
612
+        }
541 613
        
542 614
         $currentDate = date('Y-m-d');
543 615
         // 上周的开始日期(周一)
@@ -597,6 +669,18 @@ class FinanceRepository extends BaseRepository
597 669
             $bill_where = "commission_type !=5 and source=0 ";
598 670
             $yanglao_where = " commission_type =5 and source=0 ";
599 671
         }
672
+        // 需要过滤掉的用户
673
+        /** @var UserRepository $userRepository */
674
+        $userRepository = app()->make(UserRepository::class);
675
+        $invalidUidList = $userRepository->getInvalidUidList();
676
+        if (!empty($invalidUidList)) {
677
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
678
+            $where .= $invalidSqlStr;
679
+            $where_order .= $invalidSqlStr;
680
+            $bill_where .= $invalidSqlStr;
681
+            $yanglao_where .= $invalidSqlStr;
682
+        }
683
+
600 684
         if ($type == 1 and $day != '') {
601 685
             $lastDay = date('Y-m-d', strtotime($day));
602 686
             $day = $lastDay;

+ 11 - 9
app/common/repositories/store/order/StoreOrderRepository.php

@@ -7546,12 +7546,12 @@ class StoreOrderRepository extends BaseRepository
7546 7546
         //首先查询商品有没有设置佣金
7547 7547
 //        $extension = Db::name("store_product")->where("product_id", $order['product_id'])->field("mer_id,extension_type,type,commission")->find();
7548 7548
 
7549
-        // 推荐创客收益设置
7550
-        $shop_bonus_setting = merchantConfig($mer_id, 'shop_bonus_setting') ?: [
7551
-            'shop_bonus_rate' => 30,
7552
-            'yanglao_rate' => 5,
7553
-        ];
7554
-        Db::name('log')->insert(['data' => 'shop_bonus_setting:' . json_encode($shop_bonus_setting)]);
7549
+        // // 推荐创客收益设置
7550
+        // $shop_bonus_setting = merchantConfig($mer_id, 'shop_bonus_setting') ?: [
7551
+        //     'shop_bonus_rate' => 30,
7552
+        //     'yanglao_rate' => 5,
7553
+        // ];
7554
+        // Db::name('log')->insert(['data' => 'shop_bonus_setting:' . json_encode($shop_bonus_setting)]);
7555 7555
 
7556 7556
         //直推奖设置
7557 7557
         $zhitui_rate_setting = systemConfig('zhitui_rate');
@@ -7643,9 +7643,11 @@ class StoreOrderRepository extends BaseRepository
7643 7643
             //可分总佣金 暂时用不到 预留
7644 7644
             $divisible_commission = 0;
7645 7645
         } else {
7646
-            //自营商品
7647
-            //创客账户: 支付金额*(1-商户分润比例)-通道费+运费
7648
-            $shop_bonus_rate = $shop_bonus_setting['shop_bonus_rate'] ?? 0;
7646
+            //自营商品 和 商贸区
7647
+            // //创客账户: 支付金额*(1-商户分润比例)-通道费+运费
7648
+            // $shop_bonus_rate = $shop_bonus_setting['shop_bonus_rate'] ?? 0;
7649
+            $shop_bonus_rate = merchantConfig($mer_id, 'base_commission') ?: 5;
7650
+
7649 7651
             $mer_money = decimal2($pay_price * (1 - $shop_bonus_rate / 100) - $shouxufei + $total_postage);
7650 7652
 
7651 7653
             //平台金额:支付金额*商户分润比例-养老金

+ 10 - 2
app/controller/admin/order/Order.php

@@ -95,8 +95,12 @@ class Order extends BaseController
95 95
                     $item['orderProduct'][0]['cart_info']['productAttr']['price'] ?? 0.00,
96 96
                     $item['orderProduct'][0]['product_num'] ?? 0,
97 97
                     $item['pay_price'], // 订单金额
98
-                    $item['fzone_pay_note'], // 支付方式
99 98
                     $item['paid'] == 0 ? "未支付" : "已支付", // 支付状态
99
+                    $item['fzone_pay_note'], // 支付方式
100
+                    $item['fzone_pay_jifen'], // 支付方式
101
+                    $item['fzone_pay_price'], // 支付方式
102
+                    $item['fzone_pay_jingdou'], // 支付方式
103
+                    $item['fzone_pay_vr'], // 支付方式
100 104
                     $item['is_del'] == 0 ? ($item['status'] == 5 ? '待付款' : ($item['status'] == 0 ? '待发货' : ($item['status'] == 1 ? '待收货' : ($item['status'] == 2 ? '待评价' : ($item['status'] == 3 ? '已完成' : ($item['status'] == 4 ? '已申请退款' : ($item['status'] == -1 ? '已退款' : ($item['status'] == 6 ? '已取消' : '')))))))) : '已删除', // 订单状态
101 105
                     $item['create_time'], // 下单时间
102 106
                 ];
@@ -113,8 +117,12 @@ class Order extends BaseController
113 117
                 '商品单价',
114 118
                 '商品数量',
115 119
                 '订单金额',
116
-                '支付方式',
117 120
                 '支付状态',
121
+                '支付方式',
122
+                '支付积分',
123
+                '支付现金',
124
+                '支付京豆',
125
+                '支付VR',
118 126
                 '订单状态',
119 127
                 '下单时间'
120 128
             ], $arr, '订单明细'));