Просмотр исходного кода

Merge branch 'dev' into dev-sxb

sunxbiao 1 год назад
Родитель
Сommit
4566db7d5c

+ 2 - 2
app/common/repositories/store/order/StoreRefundOrderRepository.php

@@ -1016,8 +1016,8 @@ class StoreRefundOrderRepository extends BaseRepository
1016 1016
     public function moneyRefundAfter($refundOrder){
1017 1017
 //        Db::name('log')->insert(['data'=>'退款 佣金养老金退还开始']);
1018 1018
         $order_id = Db::name("store_refund_order")->where(['refund_order_id'=>$refundOrder])->value("order_id");
1019
-        //查询订单返利的数据
1020
-        $bill= Db::name("user_bill")->where(['link_id'=>$order_id,'pm'=>1])->select();
1019
+        //查询订单返利的数据 status:0 = 待确定 1 = 有效 -1 = 无效
1020
+        $bill= Db::name("user_bill")->where(['link_id'=>$order_id,'pm'=>1,'status' => 1])->select();
1021 1021
         foreach($bill as $k=>$v){
1022 1022
             //扣除下单用户养老金
1023 1023
             if($v['commission_type'] == 5){

+ 1 - 1
app/controller/api/Auth.php

@@ -1108,7 +1108,7 @@ class Auth extends BaseController
1108 1108
     function curl_java_login($phone){
1109 1109
         $curl = curl_init();
1110 1110
         curl_setopt_array($curl, array(
1111
-            CURLOPT_URL => 'http://shop.hxxfb.com/gateway/userCenter_service/userLogOnService/userPhoneLogOn',
1111
+            CURLOPT_URL => env('APP_URL') . '/gateway/userCenter_service/userLogOnService/userPhoneLogOn',
1112 1112
             CURLOPT_RETURNTRANSFER => true,
1113 1113
             CURLOPT_ENCODING => '',
1114 1114
             CURLOPT_MAXREDIRS => 10,

+ 41 - 15
app/controller/api/store/merchant/Taskorderguquan.php

@@ -18,30 +18,56 @@ class Taskorderguquan
18 18
     {
19 19
 
20 20
         /**
21
-        13231658486周行体300
22
-        13333069689魏惠新300
23
-        15832971815孟晓玮300
21
+        13231658486周行体500
22
+        13333069689魏惠新500
24 23
         13959100621周金花300
25
-        13701061395李素红100
26
-        15810064711 王   玲 200
27
-        13521438652徐立苹100
28
-        18760167163刘春梅50
24
+        13701061395李素红300
25
+        17501006833邢艳丽300
26
+        13521438652徐立苹300
27
+        15832971815孟晓玮300
28
+        18600200909陈冠霖300
29
+        15810064711 王   玲 300
30
+        18001316701闫旭300
31
+        13932925303会强300
32
+        13601071082隋彩云200
33
+        13161909228刘银霞50
34
+        18603401312黄金花 50
35
+        18760167163刘春梅 50
36
+        18911752386魏利琴50
37
+        13215917919李小秋50
29 38
         15332507711张传莲50
30 39
         15960349661吕丽娣50
31
-        18715313601大饼200
40
+        13381085923王建军50
41
+        13683609309李长生50
42
+        13601179856陈瑞元50
43
+        13901074090陈玉刚200
44
+        18715313601大饼400
32 45
         */
33 46
         $data = [
34
-            '13231658486' => 300,
35
-            '13333069689' => 300,
36
-            '15832971815' => 300,
47
+            '13231658486' => 500,
48
+            '13333069689' => 500,
37 49
             '13959100621' => 300,
38
-            '13701061395' => 100,
39
-            '15810064711' => 200,
40
-            '13521438652' => 100,
50
+            '13701061395' => 300,
51
+            '17501006833' => 300,
52
+            '13521438652' => 300,
53
+            '15832971815' => 300,
54
+            '18600200909' => 300,
55
+            '15810064711' => 300,
56
+            '18001316701' => 300,
57
+            '13932925303' => 300,
58
+            '13601071082' => 200,
59
+            '13161909228' => 50,
60
+            '18603401312' => 50,
41 61
             '18760167163' => 50,
62
+            '18911752386' => 50,
63
+            '13215917919' => 50,
42 64
             '15332507711' => 50,
43 65
             '15960349661' => 50,
44
-            '18715313601' => 200,
66
+            '13381085923' => 50,
67
+            '13683609309' => 50,
68
+            '13601179856' => 50,
69
+            '13901074090' => 200,
70
+            '18715313601' => 400
45 71
         ];
46 72
 
47 73
         $result = Db::name("user")

+ 66 - 0
app/controller/api/store/merchant/Taskorderlianc.php

@@ -13,6 +13,72 @@ use think\Request;
13 13
 class Taskorderlianc
14 14
 {
15 15
 
16
+    private const API_KEY = "EXTERNAL_SYSTEM_B_KEY";
17
+    private const API_SECRET = "STRONG_SECRET_123456";
18
+    private const GATEWAY_URL = "http://localhost:9002";
19
+
20
+    public function getUserPoints()
21
+    {
22
+        $timestamp = round(microtime(true) * 1000);  // 获取当前时间戳(毫秒)
23
+        $signature = $this->generateSignature(self::API_KEY, $timestamp);
24
+
25
+        // 设置请求头
26
+        $headers = [
27
+            "X-API-KEY: " . self::API_KEY,
28
+            "X-TIMESTAMP: " . $timestamp,
29
+            "X-SIGNATURE: " . $signature,
30
+            "Content-Type: application/json"
31
+        ];
32
+        // 请求的 POST 数据(例如用户信息)
33
+//        $postData = [
34
+//            'pm' => 1,
35
+//            'rewardScore' => 5,
36
+//            'orderId' => 'johndoe@example.com',
37
+//            'orderType' => '1234567890',
38
+//        ];
39
+        $postData = [
40
+            'uid' => 1592,
41
+            'sex' => 2,
42
+            'spreadUid' => 767
43
+        ];
44
+
45
+
46
+        // 请求 URL
47
+        // $url = self::GATEWAY_URL . "/external/userCenter_service/user/getUserList?uid=1592";
48
+        // 请求 URL POST
49
+        $url = self::GATEWAY_URL . "/external/userCenter_service/user/updateUserInfo";
50
+
51
+
52
+        // // 使用 cURL 发起 GET 请求
53
+        // $ch = curl_init();
54
+        // curl_setopt($ch, CURLOPT_URL, $url);
55
+        // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
56
+        // curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
57
+        // $response = curl_exec($ch);
58
+        // curl_close($ch);
59
+
60
+        // 使用 cURL 发起 POST 请求
61
+        $ch = curl_init();
62
+        curl_setopt($ch, CURLOPT_URL, $url);
63
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
64
+        curl_setopt($ch, CURLOPT_POST, true);
65
+        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
66
+        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData)); // 转换为 JSON 字符串
67
+        $response = curl_exec($ch);
68
+        curl_close($ch);
69
+
70
+        // 解析返回的 JSON 数据
71
+        $responseData = json_decode($response, true);
72
+
73
+        return json($responseData); // 返回用户积分,默认值为 0
74
+    }
75
+
76
+    private function generateSignature($apiKey, $timestamp)
77
+    {
78
+        $data = $apiKey . "|" . $timestamp . "|" . self::API_SECRET;
79
+        return md5($data); // 返回 MD5 签名
80
+    }
81
+
16 82
     /**
17 83
      * 会员升级
18 84
      */

+ 1 - 0
route/api.php

@@ -1310,6 +1310,7 @@ Route::get('test_hehuoren_zero', 'api.store.merchant.TaskZeroLinePartnerProfits/
1310 1310
 Route::get('test_guquan', 'api.store.merchant.Taskorderguquan/lst6');
1311 1311
 Route::get('test_lianchuang', 'api.store.merchant.Taskorderlianc/lst2');
1312 1312
 Route::get('test_lianchuang_zero', 'api.store.merchant.TaskZeroLineOrderLianc/lst2');
1313
+Route::get('test_external', 'api.store.merchant.Taskorderlianc/getUserPoints');
1313 1314
 Route::any('/share', function () {
1314 1315
     return view(app()->getRootPath() . 'public/share/register.html');
1315 1316
 });