Browse Source

Merge branch 'dev' into dev-sxb

sunxbiao 1 year ago
parent
commit
0949d7f5a1

+ 17 - 1
app/command/PensionTasks.php

@@ -18,6 +18,9 @@ use Carbon\Carbon;
18
 use think\console\Command;
18
 use think\console\Command;
19
 use think\console\Input;
19
 use think\console\Input;
20
 use think\console\Output;
20
 use think\console\Output;
21
+use think\db\exception\DataNotFoundException;
22
+use think\db\exception\DbException;
23
+use think\db\exception\ModelNotFoundException;
21
 use think\Exception;
24
 use think\Exception;
22
 use think\facade\Db;
25
 use think\facade\Db;
23
 use think\facade\Log;
26
 use think\facade\Log;
@@ -64,7 +67,7 @@ class PensionTasks extends Command
64
 //            $this->doThridVipOrderGzc($nowTime, $timeLimit = 30);
67
 //            $this->doThridVipOrderGzc($nowTime, $timeLimit = 30);
65
 //            $this->doThridDyOrderGzc($nowTime, $timeLimit = 30);
68
 //            $this->doThridDyOrderGzc($nowTime, $timeLimit = 30);
66
 //            $this->doThridHfOrderGzc($nowTime, $timeLimit = 30);
69
 //            $this->doThridHfOrderGzc($nowTime, $timeLimit = 30);
67
-//            $this->billGzcAdd($nowTime);
70
+            $this->billGzcAdd($nowTime);
68
             //升级
71
             //升级
69
 //            $this -> doUpgrade();
72
 //            $this -> doUpgrade();
70
         } catch (\Throwable $e) {
73
         } catch (\Throwable $e) {
@@ -87,10 +90,23 @@ class PensionTasks extends Command
87
         $OrderGzcRepository      = app()->make(OrderGzcRepository::class);
90
         $OrderGzcRepository      = app()->make(OrderGzcRepository::class);
88
         $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
91
         $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
89
         $StoreOrderRepository    = app()->make(StoreOrderRepository::class);
92
         $StoreOrderRepository    = app()->make(StoreOrderRepository::class);
93
+        $testUserIdList = [];
94
+        /** @var UserRepository $userRepository */
95
+        $userRepository = app()->make(UserRepository::class);
96
+        try {
97
+            $userIdData = $userRepository->selectWhere(['test_user' => 1], 'uid')->toArray();
98
+            if (!empty($userIdData)) {
99
+                $testUserIdList = array_column($userIdData, 'uid');
100
+            }
101
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
102
+
103
+        }
104
+
90
         $cursor = Db::name('user_bill')
105
         $cursor = Db::name('user_bill')
91
         ->where('status', 1)
106
         ->where('status', 1)
92
         ->where('is_gzc', 0)
107
         ->where('is_gzc', 0)
93
         ->where('commission_type', 5)
108
         ->where('commission_type', 5)
109
+        ->whereNotIn('uid', $testUserIdList)
94
         ->select()->toArray();
110
         ->select()->toArray();
95
         if($cursor) {
111
         if($cursor) {
96
             foreach ($cursor as $bill) {
112
             foreach ($cursor as $bill) {

+ 6 - 5
app/common/repositories/store/order/StoreOrderRepository.php

@@ -3130,7 +3130,7 @@ class StoreOrderRepository extends BaseRepository
3130
         Db::name("log")->insert(array('data' => '确认收货:' . json_encode($order)));//日志记录
3130
         Db::name("log")->insert(array('data' => '确认收货:' . json_encode($order)));//日志记录
3131
         if (!$order)
3131
         if (!$order)
3132
             throw new ValidateException('订单不存在');
3132
             throw new ValidateException('订单不存在');
3133
-        if ($order['status'] != 1 || $order['order_type'])
3133
+        if (!in_array($order['status'], [0, 1]) || $order['order_type'])
3134
             throw new ValidateException('订单状态有误');
3134
             throw new ValidateException('订单状态有误');
3135
         if (!$user) $user = $order->user;
3135
         if (!$user) $user = $order->user;
3136
         $order->status = 2;
3136
         $order->status = 2;
@@ -5390,15 +5390,16 @@ class StoreOrderRepository extends BaseRepository
5390
      */
5390
      */
5391
     public function carryOrder($id, $merId, $serviceId, $order_id)
5391
     public function carryOrder($id, $merId, $serviceId, $order_id)
5392
     {
5392
     {
5393
-        $order = $this->dao->getWhere(['order_id' => $order_id, 'status' => 1, 'mer_id' => $merId]);
5393
+        $order = $this->dao->getWhere(['order_id' => $order_id, 'mer_id' => $merId]);
5394
         if (!$order)
5394
         if (!$order)
5395
             throw new ValidateException('订单不存在或已支付~');
5395
             throw new ValidateException('订单不存在或已支付~');
5396
-        if ($order->verify_code != $id)
5396
+        if (!in_array($order->status, [0, 1])) {
5397
+            throw new ValidateException('订单状态错误');
5398
+        }
5399
+        if ($id != null && $order->verify_code != $id)
5397
             throw new ValidateException('提货码错误~');
5400
             throw new ValidateException('提货码错误~');
5398
         if (!$order->paid)
5401
         if (!$order->paid)
5399
             throw new ValidateException('订单未支付');
5402
             throw new ValidateException('订单未支付');
5400
-        if ($order->status != 1)
5401
-            throw new ValidateException('订单已核销');
5402
         $order->status = 2;
5403
         $order->status = 2;
5403
         $order->verify_time = date('Y-m-d H:i:s');
5404
         $order->verify_time = date('Y-m-d H:i:s');
5404
         $order->verify_service_id = $serviceId;
5405
         $order->verify_service_id = $serviceId;

+ 3 - 2
app/controller/api/store/merchant/Taskorderlianc.php

@@ -13,8 +13,8 @@ use think\Request;
13
 class Taskorderlianc
13
 class Taskorderlianc
14
 {
14
 {
15
 
15
 
16
-    private const API_KEY = "EXTERNAL_SYSTEM_B_KEY";
17
-    private const API_SECRET = "STRONG_SECRET_123456";
16
+    private const API_KEY = "HXJT_XFXD_B31_M_3279_Y_250707_01";
17
+    private const API_SECRET = '8f^ynijrE9Mc9Q5ez5e8$Tm&$6Xx!ycQ';
18
     private const GATEWAY_URL = "http://localhost:9002";
18
     private const GATEWAY_URL = "http://localhost:9002";
19
 
19
 
20
     public function getUserPoints()
20
     public function getUserPoints()
@@ -29,6 +29,7 @@ class Taskorderlianc
29
             "X-SIGNATURE: " . $signature,
29
             "X-SIGNATURE: " . $signature,
30
             "Content-Type: application/json"
30
             "Content-Type: application/json"
31
         ];
31
         ];
32
+        return json($headers);
32
         // 请求的 POST 数据(例如用户信息)
33
         // 请求的 POST 数据(例如用户信息)
33
 //        $postData = [
34
 //        $postData = [
34
 //            'pm' => 1,
35
 //            'pm' => 1,

+ 14 - 0
app/controller/merchant/store/order/Order.php

@@ -263,6 +263,20 @@ class Order extends BaseController
263
     }
263
     }
264
 
264
 
265
     /**
265
     /**
266
+     * 手动操作订单为 已自提 关单
267
+     * @return mixed
268
+     * @throws \think\db\exception\DataNotFoundException
269
+     * @throws \think\db\exception\DbException
270
+     * @throws \think\db\exception\ModelNotFoundException
271
+     */
272
+    public function carryByWithoutCode()
273
+    {
274
+        $order_id = input('order_id');
275
+        $this->repository->carryOrder(null, $this->request->merId(), 0, $order_id);
276
+        return app('json')->success('订单核销成功');
277
+    }
278
+
279
+    /**
266
      * @param $id
280
      * @param $id
267
      * @return mixed
281
      * @return mixed
268
      * @author Qinii
282
      * @author Qinii

+ 1 - 0
route/merchant.php

@@ -460,6 +460,7 @@ Route::group(config('admin.api_merchant_prefix') . '/', function () {
460
             Route::post('remark/:id', 'Order/remark')->name('merchantStoreOrderRemark');
460
             Route::post('remark/:id', 'Order/remark')->name('merchantStoreOrderRemark');
461
             Route::post('verify/:code', 'Order/verify')->name('merchantStoreOrderVerify');
461
             Route::post('verify/:code', 'Order/verify')->name('merchantStoreOrderVerify');
462
             Route::post('carry/:code', 'Order/carry')->name('merchantStoreOrderCarry');
462
             Route::post('carry/:code', 'Order/carry')->name('merchantStoreOrderCarry');
463
+            Route::post('carryByWithoutCode', 'Order/carryByWithoutCode')->name('carryByWithoutCode');// 奖励统计-导出
463
             Route::post('delete/:id', 'Order/delete')->name('merchantStoreOrderDelete');
464
             Route::post('delete/:id', 'Order/delete')->name('merchantStoreOrderDelete');
464
             Route::get('reconciliation/lst', 'Reconciliation/lst')->name('sysMerchantReconciliationLst');
465
             Route::get('reconciliation/lst', 'Reconciliation/lst')->name('sysMerchantReconciliationLst');
465
             Route::get('reconciliation/mark/:id/form', 'Reconciliation/markForm')->name('merchantReconciliationMarkForm');
466
             Route::get('reconciliation/mark/:id/form', 'Reconciliation/markForm')->name('merchantReconciliationMarkForm');