|
|
@@ -0,0 +1,182 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\api\controller\notify;
|
|
|
+
|
|
|
+use app\api\controller\BaseApiController;
|
|
|
+use app\api\logic\ThirdOrderLogic;
|
|
|
+use think\facade\Log;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * Class MeiTuanNotifyController
|
|
|
+ * @package app\api\controller\notify
|
|
|
+ */
|
|
|
+class MeiTuanNotifyController extends BaseApiController
|
|
|
+{
|
|
|
+
|
|
|
+ public array $notNeedLogin = ['submitOrder','notifyAuth','notifyReviewAuth','get_sign','test','cancellation','bookingResults','booking','changeBooking','cancellation5910003','bookingResults5910005','booking5910011','booking5910015','booking5910017'];
|
|
|
+
|
|
|
+ protected array $user_token = [
|
|
|
+ "accessToken"=>"V2-29d801e316e9ec4eb88b3b9abd8dbda490367af539d97d754420056dc5c1329a2c1aff7d4d54729ff622d96ff7c9910aa930f7b7ad27910d199c15029ffc71aa4a84142d75b60f4a34b71a8390a89d8c01a4dd385232e4e9c9204fb5934eda89",
|
|
|
+ "expireIn"=> 2592000,
|
|
|
+ "opBizCode"=> "AG5MALO18KG6I5DL8LVONRSRF5G",
|
|
|
+ "opBizName"=> "武汉开源节流科技有限公司",
|
|
|
+ "refreshToken"=> "ab8d15b4028b7bd6aca383d230b87450436d301a2996b6bb3151d668dd2d015d68d8393e66fb2a59aa10146c70dd30728b473358ec0d156dc0bc5cc5e574a109a5680ab49c393fa9d2693ef5519ff41a16115b81259b58c71a54d79e23f26381",
|
|
|
+ "scope"=> "dingdan,generalreserve,merchantreceipt,shangpin"
|
|
|
+ ];
|
|
|
+ protected array $shop_token1 = [
|
|
|
+ "accessToken"=> "V2-9667b1ce4ffaabe453d4ce847888c788c9c61762df9230ab342caf33e2b4a735a384288379641f64bb2f4272c88d44db42b080ef237cb0c5e3ae49466d72f5c1b17e8a34991e131e91a24e9947f046027af6bbbbc24e0155f6cd4d738e19b5c0",
|
|
|
+ "expireIn"=> 2592000,
|
|
|
+ "opBizCode"=> "AH14KGRJ76O8PFH4GCO67F0CUKC",
|
|
|
+ "opBizName"=> "众盾闪修 家电清洗 武汉",
|
|
|
+ "refreshToken"=> "fd3da11174eed4c3d6b4d117f87ab7b62a72603627d2d597bed82dddb1036943b8e76e2959c0c4b3cf7b33ec4664bedbca3ef14dd070f662582a1b6695077577e2268c6a42ca519fda331c7e1cdbc0919af8052151ce9ae0a658d346307ca0c1",
|
|
|
+ "scope"=> "merchantdata,poiqrcode,tuangou,ugc,yuding"
|
|
|
+ ];
|
|
|
+ protected array $shop_token2 = [
|
|
|
+ "accessToken"=> "V2-26f91ef8b515c59b97b9b4404e77dc2b2fc14b9715e3be7edb9f3f86178e193ec380e1ef5a9ab7a877120a94bcae4586707c51ab5e56cfeb4cd91d4fb2983babbbfd2fda0f77353eb21b105fd14299aea392a706589a422baec961b6cc255191",
|
|
|
+ "expireIn"=> 2592000,
|
|
|
+ "opBizCode"=> "AE7MKOJAV67338LIC3UD0K5TGIO",
|
|
|
+ "opBizName"=> "众盾闪修 家电维修 武汉",
|
|
|
+ "refreshToken"=> "bd57846c8817125f8ad7f4eb4ccad4af80c808f30c8b22e38476fc78c008b568ca8bcd8a027740023f2bcab5c0f6f062fb8a6e8f588cff53512a057c2e97a7b1789fb9fe9dc4b3fc2abf42dd753341c455e6eacb7a5e19dd4894bf1d93db9abf",
|
|
|
+ "scope"=> "merchantdata,poiqrcode,tuangou,ugc,yuding"
|
|
|
+ ];
|
|
|
+
|
|
|
+ public function notifyAuth(): void
|
|
|
+ {
|
|
|
+ Log::write('店铺权限授权CODE:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function notifyReviewAuth()
|
|
|
+ {
|
|
|
+ Log::write('店铺权限解约授权CODE:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ public 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function test()
|
|
|
+ {
|
|
|
+ $data = array("businessId"=>"58","charset" => "utf-8","code"=>"828227b6489b14300c682e7b787d9afc", "developerId" => "114657","grantType"=>"authorization_code", "timestamp" => "1741509940");
|
|
|
+ echo $this->get_sign("8471lgvnv0qcjpx6", $data);
|
|
|
+ }
|
|
|
+
|
|
|
+ //到店综合
|
|
|
+ /**
|
|
|
+ * 取消预订
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function cancellation()
|
|
|
+ {
|
|
|
+ Log::write('取消预订:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预订结果同步
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function bookingResults()
|
|
|
+ {
|
|
|
+ Log::write('预订结果同步:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 开始预约
|
|
|
+ * @return \think\response\Json
|
|
|
+ */
|
|
|
+ public function booking()
|
|
|
+ {
|
|
|
+ $order = $this->request->param();
|
|
|
+ Log::write('开始预约:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ ThirdOrderLogic::orderhandle($order);
|
|
|
+ return $this->success('开始预约');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 改约提交
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function changeBooking()
|
|
|
+ {
|
|
|
+ $order = $this->request->param();
|
|
|
+ Log::write('改约提交:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //到店综合(客服)
|
|
|
+ /**
|
|
|
+ * 商品状态变更
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function cancellation5910003()
|
|
|
+ {
|
|
|
+ Log::write('商品状态变更:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 改约结果同步三方
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function bookingResults5910005()
|
|
|
+ {
|
|
|
+ Log::write('改约结果同步三方:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消同步三方接口
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function booking5910011()
|
|
|
+ {
|
|
|
+ Log::write('取消同步三方接口:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创单同步三方接口
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function booking5910015()
|
|
|
+ {
|
|
|
+ Log::write('创单同步三方接口:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户改约
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function booking5910017()
|
|
|
+ {
|
|
|
+ Log::write('用户改约:'.json_encode($this->request->param(),JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 手动提交美团订单
|
|
|
+ * @return \think\response\Json
|
|
|
+ */
|
|
|
+ public function submitOrder()
|
|
|
+ {
|
|
|
+ $request = $this->request->param();
|
|
|
+ if(empty($request['userName']) || empty($request['mobile']) || empty($request['userAddress']) || empty($request['appointment_time']) || empty($request['goods_id']) || empty($request['amount'])){
|
|
|
+ return $this->fail('参数错误');
|
|
|
+ }
|
|
|
+ ThirdOrderLogic::submitOrders($request);
|
|
|
+ return $this->success('下单成功');
|
|
|
+ }
|
|
|
+}
|