1
0
Эх сурвалжийг харах

Merge branch 'master' of e.coding.net:zdap/weixiu/weixiu_api

liugc 1 жил өмнө
parent
commit
5e56d2aac0

+ 1 - 1
app/adminapi/controller/platform_api/MeiTuanApiController.php

@@ -46,7 +46,7 @@ class MeiTuanApiController extends BaseAdminController
         if($order['bookStatus']!=1){
             return $this->fail('订单状态异常,无法接单');
         }
-        $result = ThirdOrderLogic::bookresultcallback($order['orderId'],2);
+        $result = ThirdOrderLogic::bookresultcallback(json_decode($order['request_msg'],true)['opBizCode'],$order['orderId'],2);
         if(!empty($result['code']) && $result['code']==200){
             $order->bookStatus = 2;
             $order->save();

+ 28 - 7
app/api/controller/notify/MeiTuanNotifyController.php

@@ -46,12 +46,32 @@ class MeiTuanNotifyController extends BaseApiController
 
 
 
-//    public function test()
-//    {
-////        $data = array("businessId"=>"58","charset" => "utf-8","code"=>"828227b6489b14300c682e7b787d9afc",  "developerId" => "114657","grantType"=>"authorization_code", "timestamp" => "1741664392");
+    public function test()
+    {
+        $data = array("businessId"=>"58","charset" => "utf-8","code"=>"7355f0a0d01f31e7963f23f6e20519f5",  "developerId" => "114657","grantType"=>"authorization_code", "timestamp" => "1744107897");
 //        $data = array("businessId"=>"58","charset" => "utf-8","appAuthToken"=>"V2-26f91ef8b515c59b97b9b4404e77dc2b2fc14b9715e3be7edb9f3f86178e193ec380e1ef5a9ab7a877120a94bcae4586707c51ab5e56cfeb4cd91d4fb2983babbbfd2fda0f77353eb21b105fd14299aea392a706589a422baec961b6cc255191",  "developerId" => "114657","version"=>"2", "timestamp" => "1741663560",'biz'=>'{  "orderId": "61427436",  "bookStatus": 2,  "code": 200,"type":2}');
-//        echo $this->get_sign("8471lgvnv0qcjpx6", $data);
-//    }
+        echo $this->get_sign("8471lgvnv0qcjpx6", $data);
+    }
+
+    public static function get_sign($sign_key, $data)
+    {
+        if ($data == null) {
+            return null;
+        }
+        ksort($data);
+        $result_str = "";
+        foreach ($data as $key => $val) {
+            if ($key != "sign" && $val != null && $val != "") {
+                $result_str = $result_str . $key . $val;
+            }
+        }
+        $result_str = $sign_key . $result_str;
+
+
+        $ret = bin2hex(sha1($result_str, true));
+
+        return $ret;
+    }
 
     //到店综合
     /**
@@ -294,7 +314,7 @@ class MeiTuanNotifyController extends BaseApiController
         //尾款结算1        //尾款结算3
         //获取工单信息
         $request = $this->request->param();
-//        $request = json_decode('{"opBizCode":"AE7MKOJAV67338LIC3UD0K5TGIO","msgType":"5810031","developerId":"114657","businessId":"58","sign":"013a53f59601e5f7dd5fa1f716127384e24dbdd3","msgId":"-7483972612472674819","message":"{\"orderId\":\"62737288\",\"verifyStatus\":\"2\",\"verifyChannel\":\"1\",\"type\":\"2\",\"serialNumber\":\"1315233958\"}","timestamp":"1742907756"}',true);
+//        $request = json_decode('{"opBizCode":"AE7MKOJAV67338LIC3UD0K5TGIO","msgType":"5810031","developerId":"114657","businessId":"58","sign":"70e9ab334024101d8601276e5e3a24f459005a1e","msgId":"8401776939815074952","message":"{\"orderId\":\"63702731\",\"verifyStatus\":\"2\",\"verifyChannel\":\"1\",\"type\":\"2\",\"serialNumber\":\"4078677902\"}","timestamp":"1743944824"}',true);
         Log::write('预订核销同步:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
         if(!empty($request['message'])){
             Db::startTrans();
@@ -382,7 +402,8 @@ class MeiTuanNotifyController extends BaseApiController
 
     public function bookresultcallback()
     {
-        ThirdOrderLogic::bookresultcallback('61427436',2);
+        $a = ThirdOrderLogic::bookresultcallback('AE7MKOJAV67338LIC3UD0K5TGIO','63950625',2);
+        dd($a);
     }
 
 

+ 4 - 4
app/common/logic/ThirdOrderLogic.php

@@ -37,19 +37,19 @@ class ThirdOrderLogic extends BaseLogic
         "scope"=> "dingdan,generalreserve,merchantreceipt,shangpin"
     ];
     protected const shop_token1 = [
-        "accessToken"=> "V2-9667b1ce4ffaabe453d4ce847888c788c9c61762df9230ab342caf33e2b4a735a384288379641f64bb2f4272c88d44db42b080ef237cb0c5e3ae49466d72f5c1b17e8a34991e131e91a24e9947f046027af6bbbbc24e0155f6cd4d738e19b5c0",
+        "accessToken"=> "V2-9667b1ce4ffaabe453d4ce847888c788c9c61762df9230ab342caf33e2b4a735ade021c559312195b7f01f30f3bdd44cf6f8528b1fd1ad1541ceabeb7da61156c852e314aae26eef9d52fb41fda585c566c18e05dc3cbb61733b2f71c05a78f6",
         "expireIn"=> 2592000,
         "opBizCode"=> "AH14KGRJ76O8PFH4GCO67F0CUKC",
         "opBizName"=> "众盾闪修 家电清洗 武汉",
-        "refreshToken"=> "fd3da11174eed4c3d6b4d117f87ab7b62a72603627d2d597bed82dddb1036943b8e76e2959c0c4b3cf7b33ec4664bedbca3ef14dd070f662582a1b6695077577e2268c6a42ca519fda331c7e1cdbc0919af8052151ce9ae0a658d346307ca0c1",
+        "refreshToken"=> "fd3da11174eed4c3d6b4d117f87ab7b62a72603627d2d597bed82dddb103694375ed9cab1944bc7437a204b171303cb3c0976fbddc88708e75f2169c532a28614ff36c68486a75cb9dbf0391e39d6dfa8bec0bf18b54b5d2119d895788a2281c",
         "scope"=> "merchantdata,poiqrcode,tuangou,ugc,yuding"
     ];
     protected const shop_token2 = [
-        "accessToken"=> "V2-26f91ef8b515c59b97b9b4404e77dc2b2fc14b9715e3be7edb9f3f86178e193ec380e1ef5a9ab7a877120a94bcae4586707c51ab5e56cfeb4cd91d4fb2983babbbfd2fda0f77353eb21b105fd14299aea392a706589a422baec961b6cc255191",
+        "accessToken"=> "V2-26f91ef8b515c59b97b9b4404e77dc2b2fc14b9715e3be7edb9f3f86178e193e21513ea76f021c503890172cad1863ea544d6b4c7b8b3790374ba912c15ad9e71e32ba0b195d38131da3584a59603ea55e81d1b3203a57ae280c36cbb67f5ffc",
         "expireIn"=> 2592000,
         "opBizCode"=> "AE7MKOJAV67338LIC3UD0K5TGIO",
         "opBizName"=> "众盾闪修 家电维修 武汉",
-        "refreshToken"=> "bd57846c8817125f8ad7f4eb4ccad4af80c808f30c8b22e38476fc78c008b568ca8bcd8a027740023f2bcab5c0f6f062fb8a6e8f588cff53512a057c2e97a7b1789fb9fe9dc4b3fc2abf42dd753341c455e6eacb7a5e19dd4894bf1d93db9abf",
+        "refreshToken"=> "bd57846c8817125f8ad7f4eb4ccad4af80c808f30c8b22e38476fc78c008b568376db34916f190e086272f6da315ac2ce4daefac6e61e4ce8889500f293e95537f6939f810f0466c8181086b052907c68b01a6d59ac5fe78abbae0ecd54578f5",
         "scope"=> "merchantdata,poiqrcode,tuangou,ugc,yuding"
     ];
     protected const developerId = 114657;