From 64fc7cf480a110d931232bc9d5a0f112909315f6 Mon Sep 17 00:00:00 2001 From: wh <382379437@qq.com> Date: Wed, 17 Jul 2024 11:54:52 +0800 Subject: [PATCH] fixed --- .../vendor/composer/autoload_classmap.php | 5 - .../vendor/composer/autoload_files.php | 3 - .../vendor/composer/autoload_psr4.php | 15 -- .../vendor/composer/autoload_static.php | 95 ------- digital_doctor/vendor/composer/installed.json | 5 +- digital_doctor/vendor/composer/installed.php | 6 +- .../src/alibaba/AlibabaAuth.php | 160 +++++++++++ .../src/alibaba/distributes/BaseStrict.php | 23 ++ .../src/alibaba/distributes/README.MD | 3 + .../src/alibaba/distributes/Testexample.php | 144 ++++++++++ .../distributes/notify/BaseStrictNotify.php | 55 ++++ .../distributes/notify/ProductNotify.php | 48 ++++ .../src/alibaba/distributes/notify/README.MD | 3 + .../distributes/strict/CustomerService.php | 27 ++ .../src/alibaba/distributes/strict/README.MD | 4 + .../distributes/strict/StrictCategory.php | 63 +++++ .../distributes/strict/StrictGoods.php | 146 ++++++++++ .../distributes/strict/StrictLogistics.php | 39 +++ .../distributes/strict/StrictOrder.php | 250 ++++++++++++++++++ .../alibaba/distributes/strict/StrictPay.php | 33 +++ .../base/BaseWechatAuthController.php | 8 +- .../src/tool/Tools.php | 62 +++++ 22 files changed, 1070 insertions(+), 127 deletions(-) create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/README.MD create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/CustomerService.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php create mode 100644 digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php diff --git a/digital_doctor/vendor/composer/autoload_classmap.php b/digital_doctor/vendor/composer/autoload_classmap.php index dc15c48..b26f1b1 100644 --- a/digital_doctor/vendor/composer/autoload_classmap.php +++ b/digital_doctor/vendor/composer/autoload_classmap.php @@ -6,10 +6,5 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/digital_doctor/vendor/composer/autoload_files.php b/digital_doctor/vendor/composer/autoload_files.php index 4bc64d1..9e44cd8 100644 --- a/digital_doctor/vendor/composer/autoload_files.php +++ b/digital_doctor/vendor/composer/autoload_files.php @@ -7,11 +7,8 @@ $baseDir = dirname($vendorDir); return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 'ffc1d7141d4fcbaeb47a6929f0811ed1' => $vendorDir . '/topthink/think-worker/src/command.php', ); diff --git a/digital_doctor/vendor/composer/autoload_psr4.php b/digital_doctor/vendor/composer/autoload_psr4.php index d69583d..bd353dc 100644 --- a/digital_doctor/vendor/composer/autoload_psr4.php +++ b/digital_doctor/vendor/composer/autoload_psr4.php @@ -12,19 +12,6 @@ return array( 'app\\' => array($baseDir . '/application'), 'Workerman\\' => array($vendorDir . '/workerman/workerman'), 'WebSocket\\' => array($vendorDir . '/textalk/websocket/lib'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), - 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), - 'React\\Stream\\' => array($vendorDir . '/react/stream/src'), - 'React\\Socket\\' => array($vendorDir . '/react/socket/src'), - 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), - 'React\\Http\\' => array($vendorDir . '/react/http/src'), - 'React\\EventLoop\\' => array($vendorDir . '/react/event-loop/src'), - 'React\\Dns\\' => array($vendorDir . '/react/dns/src'), - 'React\\Cache\\' => array($vendorDir . '/react/cache/src'), - 'Ratchet\\RFC6455\\' => array($vendorDir . '/ratchet/rfc6455/src'), - 'Ratchet\\' => array($vendorDir . '/cboden/ratchet/src/Ratchet'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), @@ -38,6 +25,4 @@ return array( 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'GatewayWorker\\' => array($vendorDir . '/workerman/gateway-worker/src'), - 'Fig\\Http\\Message\\' => array($vendorDir . '/fig/http-message-util/src'), - 'Evenement\\' => array($vendorDir . '/evenement/evenement/src'), ); diff --git a/digital_doctor/vendor/composer/autoload_static.php b/digital_doctor/vendor/composer/autoload_static.php index 7d9cc50..cdc7953 100644 --- a/digital_doctor/vendor/composer/autoload_static.php +++ b/digital_doctor/vendor/composer/autoload_static.php @@ -8,12 +8,9 @@ class ComposerStaticInit296bd8a1d28e39d56dcd80ce7be249f3 { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', 'ffc1d7141d4fcbaeb47a6929f0811ed1' => __DIR__ . '/..' . '/topthink/think-worker/src/command.php', ); @@ -36,25 +33,6 @@ class ComposerStaticInit296bd8a1d28e39d56dcd80ce7be249f3 'Workerman\\' => 10, 'WebSocket\\' => 10, ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Component\\Routing\\' => 26, - 'Symfony\\Component\\HttpFoundation\\' => 33, - ), - 'R' => - array ( - 'React\\Stream\\' => 13, - 'React\\Socket\\' => 13, - 'React\\Promise\\' => 14, - 'React\\Http\\' => 11, - 'React\\EventLoop\\' => 16, - 'React\\Dns\\' => 10, - 'React\\Cache\\' => 12, - 'Ratchet\\RFC6455\\' => 16, - 'Ratchet\\' => 8, - ), 'P' => array ( 'Psr\\Log\\' => 8, @@ -80,14 +58,6 @@ class ComposerStaticInit296bd8a1d28e39d56dcd80ce7be249f3 'GuzzleHttp\\' => 11, 'GatewayWorker\\' => 14, ), - 'F' => - array ( - 'Fig\\Http\\Message\\' => 17, - ), - 'E' => - array ( - 'Evenement\\' => 10, - ), ); public static $prefixDirsPsr4 = array ( @@ -115,58 +85,6 @@ class ComposerStaticInit296bd8a1d28e39d56dcd80ce7be249f3 array ( 0 => __DIR__ . '/..' . '/textalk/websocket/lib', ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Component\\Routing\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/routing', - ), - 'Symfony\\Component\\HttpFoundation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/http-foundation', - ), - 'React\\Stream\\' => - array ( - 0 => __DIR__ . '/..' . '/react/stream/src', - ), - 'React\\Socket\\' => - array ( - 0 => __DIR__ . '/..' . '/react/socket/src', - ), - 'React\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/react/promise/src', - ), - 'React\\Http\\' => - array ( - 0 => __DIR__ . '/..' . '/react/http/src', - ), - 'React\\EventLoop\\' => - array ( - 0 => __DIR__ . '/..' . '/react/event-loop/src', - ), - 'React\\Dns\\' => - array ( - 0 => __DIR__ . '/..' . '/react/dns/src', - ), - 'React\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/react/cache/src', - ), - 'Ratchet\\RFC6455\\' => - array ( - 0 => __DIR__ . '/..' . '/ratchet/rfc6455/src', - ), - 'Ratchet\\' => - array ( - 0 => __DIR__ . '/..' . '/cboden/ratchet/src/Ratchet', - ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', @@ -220,23 +138,10 @@ class ComposerStaticInit296bd8a1d28e39d56dcd80ce7be249f3 array ( 0 => __DIR__ . '/..' . '/workerman/gateway-worker/src', ), - 'Fig\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/fig/http-message-util/src', - ), - 'Evenement\\' => - array ( - 0 => __DIR__ . '/..' . '/evenement/evenement/src', - ), ); public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/digital_doctor/vendor/composer/installed.json b/digital_doctor/vendor/composer/installed.json index 22602ac..b0cd0cd 100644 --- a/digital_doctor/vendor/composer/installed.json +++ b/digital_doctor/vendor/composer/installed.json @@ -1209,12 +1209,12 @@ "source": { "type": "git", "url": "https://gitee.com/drop_drop/general_utility_tools_php.git", - "reference": "f31ce1f3910b7522d37a796759722f7f4c785dfe" + "reference": "622c42b186706c0d7354d04b8c957fe715d0c177" }, "require": { "ext-json": "*" }, - "time": "2024-06-27T03:06:27+00:00", + "time": "2024-07-16T13:13:35+00:00", "default-branch": true, "type": "library", "installation-source": "source", @@ -1223,6 +1223,7 @@ "wanghua\\general_utility_tools_php\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], diff --git a/digital_doctor/vendor/composer/installed.php b/digital_doctor/vendor/composer/installed.php index 91638d0..da1c49e 100644 --- a/digital_doctor/vendor/composer/installed.php +++ b/digital_doctor/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '09ae48941229f26b04631d081e85a2f29bf91be2', + 'reference' => '192dd13412c3c73d9be25f9bfece9451588338bf', 'name' => 'topthink/think', 'dev' => true, ), @@ -189,7 +189,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '09ae48941229f26b04631d081e85a2f29bf91be2', + 'reference' => '192dd13412c3c73d9be25f9bfece9451588338bf', 'dev_requirement' => false, ), 'topthink/think-installer' => array( @@ -218,7 +218,7 @@ 'aliases' => array( 0 => '9999999-dev', ), - 'reference' => 'f31ce1f3910b7522d37a796759722f7f4c785dfe', + 'reference' => '622c42b186706c0d7354d04b8c957fe715d0c177', 'dev_requirement' => false, ), 'workerman/gateway-worker' => array( diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php new file mode 100644 index 0000000..abb5144 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php @@ -0,0 +1,160 @@ +config = $config; + } + + function trusteeshipAuth(){ + //待开发 + } + + /** + * desc:授权分为托管式授权和WEB端授权,这里是WEB端授权(后去code临时凭证) + * + * author:wh + * @param string $appKey app注册时,分配给app的唯一标识 + * @param string $redirect_uri app的入口地址,授权临时令牌会以queryString的形式跟在该url后返回。注意参数中回调地址的域名必须与app注册时填写的回调地址的域名匹配。 + * @param string $site site参数标识当前授权的站点,直接填写1688 + * @param string $state 可选,app自定义参数,回跳到redirect_uri时,会原样返回 + * return 用户输入用户名密码,并确认授权,返回临时授权码code给app,具体返回方式,参照redirect_uri说明 + */ + function webAppAuth($redirect_uri,$site='1688',$state=''){ + $appKey = $this->config['appkey']; + + $url = "https://auth.1688.com/oauth/authorize?client_id={$appKey}&site={$site}&redirect_uri={$redirect_uri}&state={$state}"; + + + //$res = Curl::curl_post($url,[]); + return ""; + } + + /** + * desc:使用code获取令牌【code有效期(2分钟)】 + * + * 注:此接口必须使用POST方法提交;必须使用https + getToken接口参数说明: + a) grant_type为授权类型,使用authorization_code即可 + b) need_refresh_token为是否需要返回refresh_token,如果返回了refresh_token,原来获取的refresh_token也不会失效,除非超过半年有效期 + c) client_id为app唯一标识,即appKey + d) client_secret为app密钥 + e) redirect_uri为app入口地址 + f) code为授权完成后返回的一次性令牌 + g) 调用getToken接口不需要签名 + 注:如果超过code有效期(2分钟)或者已经使用code获取了一次令牌,code都将失效,需要返回第二步重新获取code + * author:wh + */ + function getTokenByCode($code,$redirect_uri){ + $appkey = $this->config['appkey']; + $secret = $this->config['appsecret']; + $url = "https://gw.open.1688.com/openapi/"; + $urlPath = "http/1/system.oauth2/getToken/".$appkey; + $paramstr = "?grant_type=authorization_code&need_refresh_token=true&client_id={$appkey}&client_secret={$secret}&redirect_uri={$redirect_uri}&code={$code}"; + + $url = $url.$urlPath.$paramstr; + return Curl::curl_post($url,[]); + } + + /** + * 生成签名 + * + 1、 构造urlPath。urlPath是url 中的一部分,从协议开始截取,到“?”为止,包含了协议、namespace、apiName和apiVersion,如urlPath=http/1/system/currentTime/1688 + + 2、 拼装参数。首先将所有参数按照key+value拼装得到一个字符串数组(如[b1,a2]),然后对数组进行排序([a2,b1]),最后将排序后的数组合并为字符串(a2b1) + + 3、 合并。把前两步的字符串拼接(http/1/system/currentTime/1688a2b1) + + 4、 执行hmac_sha1算法。 Signature=uppercase (hex (hmac_sha1 (concatString, secretKey)),假设secretKey=test123,那么得到的签名为2F1E96587451DE0E171978F4AAE1A90FF9B2F94B + + a) concatString为合并后的字符串 + + b) secretKey为签名密钥,与urlPath中的appKey(1000000)对应 + + c) hmac_sha1为通用的hmac_sha1算法,各编程语言一般都对应类库 + + d) hex为转为十六进制 + + e) uppercase为转为大写字符 + * author:wh + * @param string $urlPath eg: param2/1/com.alibaba.trade/alibaba.trade.fastCreateOrder/7571561 + * @param array $params 请求参数 + * @return string + */ + public function signature($urlPath,$params) + { + $accessToken = $this->config['accessToken']; + $params['access_token'] = $accessToken; + //$url = 'http://gw.open.1688.com/openapi';//1688开放平台使用gw.open.1688.com域名 + //$appKey = $this->config['appkey']; + $appSecret = $this->config['appsecret']; + + //dump('$urlPath: '.$urlPath); + //$apiInfo = 'param2/1/system/currentTime/' . $appKey;//此处请用具体api进行替换 + //$urlPath = $urlPath . $appKey;//此处请用具体api进行替换 + + //配置参数,请用apiInfo对应的api参数进行替换 + $aliParams = array(); + foreach ($params as $key => $val) { + $aliParams[] = $key . $val; + } + sort($aliParams); + $sign_str = join('', $aliParams); + $sign_str = $urlPath . $sign_str; + $code_sign = strtoupper(bin2hex(hash_hmac("sha1", $sign_str, $appSecret, true))); + + return $code_sign; + } + + /** + * desc:发起请求,自动完成签名并返回结果 + * author:wh + * @param string $urlPath eg: param2/1/com.alibaba.trade/alibaba.trade.fastCreateOrder/23222222 + * @param array $request_data 接口请求数据 + */ + function request($urlPath, $request_data){ + set_time_limit(0); + $request_params_str = ''; + foreach ($request_data as $k=>$v){ + if($request_params_str == ''){ + $request_params_str .= $k.'='.$v; + }else{ + $request_params_str .= '&'.$k.'='.$v; + } + } + $accessToken = $this->config['accessToken']; + //dump($request_params_str); + $_aop_signature = $this->signature($urlPath,$request_data); + //dump($_aop_signature); + //$request_data['_aop_signature'] = $_aop_signature; + + $url = $this->base_url.$urlPath.'?'.$request_params_str.'&access_token='.$accessToken.'&_aop_signature='.$_aop_signature; + //dump($url); + $res = Curl::curl_post($url,[]); + return $res; + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php new file mode 100644 index 0000000..1c921cb --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php @@ -0,0 +1,23 @@ +authObj = $authObj; + //初始化并设置当前模块的基础url + $this->authObj->base_url = $this->base_url; + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD new file mode 100644 index 0000000..d187b94 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD @@ -0,0 +1,3 @@ +## distributes 分销模块 + +### strict 分销中严选模块(商家自营) \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php new file mode 100644 index 0000000..bc6cdce --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php @@ -0,0 +1,144 @@ +queryOrderIsNoPassPay(); + } + function getLogisticsTemplate(){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictLogistics($authObj); + return $obj->getLogisticsTemplate(); + } + //物流模板详情 + function getLogisticsTemplateDetail($template_id){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictLogistics($authObj); + return $obj->getLogisticsTemplateDetail($template_id); + } + function getGoodsList($where){ + set_time_limit(0); + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictGoods($authObj); + return $obj->getGoodsList($where); + } + function getGoodsListsPft($where){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictGoods($authObj); + return $obj->getGoodsListsPft($where); + } + function getGoodsDetail(array $itemIds){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictGoods($authObj); + return $obj->getGoodsDetail($itemIds); + } + function getCategoryByCID($category_id){ + + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictCategory($authObj); + return $obj->getCategoryByCID($category_id); + } + function testGetRootCategory(){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $obj = new StrictCategory($authObj); + return $obj->getRootCategory(); + } + + function testWebAuth($redirect_uri){ + $config = config('meebo_supply_config'); + $res = (new AlibabaAuth($config))->webAppAuth($redirect_uri); + return $res; + } + function getTokenByCode($code,$redirect_uri){ + $config = config('meebo_supply_config'); + $res = (new AlibabaAuth($config))->getTokenByCode($code,$redirect_uri); + return $res; + } + //测试创建订单 + function createOrder(){ + $order_info = Db::table(TabConf::$fa_order) + ->where('orderid','mm70wgex1719586377768') + ->find(); + $address = Db::table(TabConf::$fa_useraddress) + ->where('id',$order_info['useraddress_id']) + ->where('users_id',$order_info['users_id']) + ->find(); + $goods = Db::table(TabConf::$fa_goods) + ->where('id',$order_info['goods_id']) + ->find(); + + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $order = new StrictOrder($authObj); + $order->setAddress($address); + $order->setGoods($goods,$order_info['buy_num']); + return $order->createOrder($order_info); + } + + function previewOrder(){ + $order_info = Db::table(TabConf::$fa_order) + ->where('orderid','mm70wgex1719586377768') + ->find(); + $address = Db::table(TabConf::$fa_useraddress) + ->where('id',$order_info['useraddress_id']) + ->where('users_id',$order_info['users_id']) + ->find(); + $goods = Db::table(TabConf::$fa_goods) + ->where('id',$order_info['goods_id']) + ->find(); + + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $order = new StrictOrder($authObj); + $order->setAddress($address); + $order->setGoods($goods,$order_info['buy_num']); + return $order->previewOrder(); + } + + //获取唤起旺旺聊天的链接 + function getCustomerServiceLink($toOpenUid){ + $config = config('meebo_supply_config'); + $authObj = new AlibabaAuth($config); + $order = new CustomerService($authObj); + return $order->getCustomerServiceLink($toOpenUid); + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php new file mode 100644 index 0000000..4b28e83 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php @@ -0,0 +1,55 @@ +$message_data]); + if(empty($message_data['type'])){ + return Tools::set_fail('type为空'); + } + //获取消息类型 + $fn = strtolower($message_data['type']);//类型即为方法名 + //消息类型前缀即为类名 + $class = '\\app\\index\\logic\\alibaba\\distributes\\notify\\'.ucfirst(explode('_',$fn)[0]).'Notify'; + $this->object = (new $class());//实例化类 + return $this->object->{$fn}($callback);//调用方法 + }); + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php new file mode 100644 index 0000000..a2115c2 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php @@ -0,0 +1,48 @@ +authObj->config['appkey']; + + return $this->authObj->request($urlPath, ['toOpenUid'=>$toOpenUid]); + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD new file mode 100644 index 0000000..34ded96 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD @@ -0,0 +1,4 @@ +## 分销严选模块 +只能使用分销严选方案里的接口 +DOC: +https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.product:alibaba.category.get-1&aopApiCategory=category_new \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php new file mode 100644 index 0000000..502717c --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php @@ -0,0 +1,63 @@ +authObj->config['appkey']; + + $request_data = []; + $request_data['categoryID'] = '0'; + return $this->authObj->request($urlPath,$request_data); + } + + /** + * desc:根据类目id获取类目信息 + * author:wh + * @param $category_id + * @return mixed + */ + function getCategoryByCID($category_id){ + $urlPath = "param2/1/com.alibaba.product/alibaba.category.get/".$this->authObj->config['appkey']; + $request_data = []; + $request_data['categoryID'] = $category_id; + return $this->authObj->request($urlPath,$request_data); + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php new file mode 100644 index 0000000..4115b91 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php @@ -0,0 +1,146 @@ +authObj->config['appkey']; + + //$request_data = []; + //foreach ($where as $k=>$v){ + // $request_data[$k] = $v; + //} + + return $this->authObj->request($urlPath, $request_data); + } + + + /** + *@deprecated 【官方说是老接口,推荐上面的新接口】 + * desc:[批发团]分销严选商品列表查询(itemId就是offerId) + * + * 精选货源商品列表查询,查询到的商品铺货至下游产生订单后,请采用ttpft的交易flow下单,精选货源商品下单目前仅支持单商品下单。 + * + * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.fenxiao:alibaba.pifatuan.product.list-1 + * + * author:wh + * @param array $request_data 查询条件,根据接口文档传值 + * @return mixed + */ + function getGoodsListsPft($request_data = []){ + //$base_url = "https://gw.open.1688.com/openapi/"; + $urlPath = "param2/1/com.alibaba.fenxiao/alibaba.pifatuan.product.list/".$this->authObj->config['appkey']; + + //$request_data = []; + //foreach ($where as $k=>$v){ + // $request_data[$k] = $v; + //} + + return $this->authObj->request($urlPath, $request_data); + } + + /** + * 商品sku信息查询(itemId就是offerId) + * + * sku信息查询,用于页面选品后,查询商品的sku,采用接口下单 + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.product:product.skuinfo.get-1 + */ + function getGoodsSkuInfo($offerId){ + $urlPath = "param2/1/com.alibaba.product/product.skuinfo.get/".$this->authObj->config['appkey']; + + $request_data = ['offerId'=>$offerId]; + + return $this->authObj->request($urlPath, $request_data); + } + + /** + * desc:获取商品详情 + * + * @param string $itemId 商品列表返回的itemId就是offerId + * + * doc:https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.fenxiao:alibaba.pifatuan.product.detail.list-2 + * + */ + function getGoodsDetail(array $itemIds){ + + $urlPath = "param2/1/com.alibaba.fenxiao/alibaba.pifatuan.product.detail.list/".$this->authObj->config['appkey']; + + //精选货源offerIds 示例值[682162000966] + $request_data = ['offerIds'=>json_encode($itemIds)]; + + return $this->authObj->request($urlPath, $request_data); + } + + /** + * desc:关注商品 + * author:wh + * @param string $productId 商品id 3412111233445 + * + * { + "code": 0, + "message": "success" + } + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.product:alibaba.product.follow-1 + */ + function followGoods($productId){ + $urlPath = "param2/1/com.alibaba.fenxiao/alibaba.product.follow/".$this->authObj->config['appkey']; + + return $this->authObj->request($urlPath, ['productId'=>$productId]); + } + + /** + * 精选货源商品列表筛选条件枚举值查询 + * + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.fenxiao:jxhy.productFilter.get-1 + */ + function getGoodsFilter(){ + $urlPath = "param2/1/com.alibaba.fenxiao/jxhy.productFilter.get/".$this->authObj->config['appkey']; + + return $this->authObj->request($urlPath, []); + } + + /** + * 解除关注 + * + * { + "code": 0, + "message": "success" + } + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.product:alibaba.product.unfollow.crossborder-1 + */ + function unfollowGoods($productId){ + $urlPath = "param2/1/com.alibaba.product/alibaba.product.unfollow.crossborder/".$this->authObj->config['appkey']; + return $this->authObj->request($urlPath, ['productId'=>$productId]); + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php new file mode 100644 index 0000000..7a6b7e1 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php @@ -0,0 +1,39 @@ +authObj->config['appkey']; + + return $this->authObj->request($urlPath, ['templateId'=>$template_id]); + } + function getLogisticsTemplate(){ + $urlPath = "param2/1/com.alibaba.logistics/alibaba.logistics.myFreightTemplate.list.get/".$this->authObj->config['appkey']; + + return $this->authObj->request($urlPath, []); + } + +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php new file mode 100644 index 0000000..cb62376 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php @@ -0,0 +1,250 @@ +address = [ + //'addressId'=>$address['id'], + 'address'=>$address['address'],//街道地 网商路699号 + 'phone'=>$address['mobile'],//电话 0517-88990077 + 'mobile'=>$address['mobile'],//手机 + 'fullName'=>$address['name'], + 'postCode'=>'000000',//邮编 000000 + 'areaText'=>$address['area'],//区文本 + 'townText'=>$address['town'],//镇文本 + 'cityText'=>$address['city'],//市文本 + 'provinceText'=>$address['provice'],//省份文本 + //'districtCode'=>'000000',//地址编码 310107 + ]; + + } + function setGoods($goods,$buy_num){ + $this->goods = [ + 'offerId'=>$goods['offerid'], + 'specId'=>$goods['specid'],//商品规格id + 'quantity'=>$buy_num,//$goods['quantity'],//商品数量(计算金额用) + + ]; + } + /** + * desc:创建分销订单 + * + * 获取订单运费,请调用预览订单接口 alibaba.createOrder.preview + * author:wh + */ + function createOrder($order){ + if(empty($this->authObj)){ + throw new Exception('未初始化授权对象'); + } + if(empty($this->address)){ + throw new Exception('未设置收货地址'); + } + if(empty($this->goods)){ + throw new Exception('未设置商品信息'); + } + //$base_url = "https://gw.open.1688.com/openapi/"; + $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.fastCreateOrder/".$this->authObj->config['appkey']; + + if(empty($this->tradeType)){ + throw new Exception('交易类型必须'); + } + $request_data = ['tradeType'=>$this->tradeType]; + + //boutiquefenxiao(新分销严选) + $request_data['flow'] = 'boutiquefenxiao'; + $request_data['isvBizTypeStr'] = 'fenxiaoMedia'; + + $request_data['message'] = $order['remark'];//买家留言 + //地址 + $request_data['addressParam'] = json_encode($this->address,JSON_UNESCAPED_UNICODE); + //商品信息 + $request_data['cargoParamList'] = json_encode($this->goods,JSON_UNESCAPED_UNICODE); + //发票信息 + $request_data['invoiceParam'] = json_encode($this->invoice,JSON_UNESCAPED_UNICODE); + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + + /** + * 创建订单前预览数据接口 + * + * 订单创建只允许购买同一个供应商的商品。 + * 本接口返回创建订单相关的优惠等信息。 + * 1、校验商品数据是否允许订购。 2、校验代销关系 3、校验库存、起批量、是否满足混批条件 + * + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.createOrder.preview-1&aopApiCategory=trade_new + */ + function previewOrder(){ + $urlPath = "param2/1/com.alibaba.trade/alibaba.createOrder.preview/".$this->authObj->config['appkey']; + $request_data = []; + //boutiquefenxiao(新分销严选) + $request_data['flow'] = 'boutiquefenxiao'; + //$request_data['isvBizTypeStr'] = 'fenxiaoMedia'; + + //$request_data['message'] = $order['remark'];//买家留言 + //地址 + $request_data['addressParam'] = json_encode($this->address,JSON_UNESCAPED_UNICODE); + //商品信息 + $request_data['cargoParamList'] = json_encode($this->goods,JSON_UNESCAPED_UNICODE); + //发票信息 + $request_data['invoiceParam'] = json_encode($this->invoice,JSON_UNESCAPED_UNICODE); + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + + /** + * 取消交易 + * + * 买家或者卖家取消交易,注意只有特定状态的交易才能取消,1688可用于取消未付款的订单。 + * + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.cancel-1&aopApiCategory=trade_new + * + * author:wh + * @param string $order_id 订单号 + * @param string $cancelReason 原因描述;buyerCancel:买家取消订单;sellerGoodsLack:卖家库存不足;other:其它 + * + * 返回:{ + "success": true + } + */ + function cancelOrder($order_id, $cancelReason, $remark=''){ + $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.cancel/".$this->authObj->config['appkey']; + $request_data = []; + $request_data['tradeID'] = $order_id; + $request_data['webSite'] = 1688; + //原因描述;buyerCancel:买家取消订单;sellerGoodsLack:卖家库存不足;other:其它 + $request_data['cancelReason'] = $cancelReason; + if($remark){ + $request_data['remark'] = $remark; + } + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + + /** + * 修改订单备忘 + * + * 授权用户为卖家修改卖家备忘,授权用户为买家修改买家备忘 注意:该接口可重复调用,备注内容将覆盖前一次调用 + * + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.order.memoAdd-1&aopApiCategory=trade_new + * + */ + function updateOrderRemark($order_id,$remark){ + $urlPath = "param2/1/com.alibaba.trade/alibaba.order.memoAdd/".$this->authObj->config['appkey']; + $request_data = []; + $request_data['orderId'] = $order_id; + $request_data['memo'] = $remark; + //备忘图标,目前仅支持数字。1位红色图标,2为蓝色图标,3为绿色图标,4为黄色图标 + $request_data['remarkIcon'] = 2; + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + + /** + * 根据地址解析地区码 + * + * 根据地址信息,解析地区码 + * + * doc:https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.addresscode.parse-1&aopApiCategory=trade_new + * + *返回:{ + "result": { + "address": "网商路699号", + "addressCode": "330108", + "isDefault": false, + "latest": false, + "postCode": "310051" + } + } + */ + function getAreaCode($address){ + $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.addresscode.parse/".$this->authObj->config['appkey']; + $request_data = []; + //地址信息 eg: 浙江省 杭州市 滨江区网商路699号 + $request_data['addressInfo'] = $address; + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + + /** + * 获取交易地址代码表详情 + * + * 获取交易地址代码表,该API会返回输入code的详情和该code的下一级地区code. + * + * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.addresscode.get-1&aopApiCategory=trade_new + * + * 返回:{ + "result": { + "code": "330108", + "name": "滨江区", + "parentCode": "330100", + "post": "310051", + "children": ["330108001", + "330108002", + "330108003"] + } + } + */ + function getAreaCodeDetail($areaCode){ + $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.addresscode.get/".$this->authObj->config['appkey']; + $request_data = []; + //地址code码 eg: 330108 + $request_data['areaCode'] = $areaCode; + $request_data['webSite'] = 1688; + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } + +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php new file mode 100644 index 0000000..3ede373 --- /dev/null +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php @@ -0,0 +1,33 @@ +authObj->config['appkey']; + $request_data = []; + + $res = $this->authObj->request($urlPath, $request_data); + return $res; + } +} \ No newline at end of file diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/framework/base/BaseWechatAuthController.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/framework/base/BaseWechatAuthController.php index 9aeb551..763a9fe 100644 --- a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/framework/base/BaseWechatAuthController.php +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/framework/base/BaseWechatAuthController.php @@ -122,10 +122,10 @@ class BaseWechatAuthController extends BaseController 'unionid' => isset($wx_user_info['unionid']) ? $wx_user_info['unionid'] : '', 'privilege' => $wx_user_info['privilege'], 'sex' => $wx_user_info['sex'], - 'arm_group' => '', - 'score' => 0,//积分 - 'group_buy_earnings' => 0,//拼团收益 - 'water_drop_balance' => 0,//水滴 + //'arm_group' => '', + //'score' => 0,//积分 + //'group_buy_earnings' => 0,//拼团收益 + //'water_drop_balance' => 0,//水滴 ]; Db::table($this->wechat_user_table_name) ->data($data) diff --git a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/tool/Tools.php b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/tool/Tools.php index 152c6c2..c605758 100644 --- a/digital_doctor/vendor/wanghua/general-utility-tools-php/src/tool/Tools.php +++ b/digital_doctor/vendor/wanghua/general-utility-tools-php/src/tool/Tools.php @@ -225,6 +225,7 @@ class Tools return json_encode($r, JSON_UNESCAPED_UNICODE); } /** + * @deprecated 废除,2027年1月1日以后移除 * desc:socket专用json格式 * * author:wh @@ -243,6 +244,67 @@ class Tools ]; return json_encode($json, JSON_UNESCAPED_UNICODE); } + /** + * desc:socket专用json格式 + * + * author:wh + * @param $action + * @param string $msg + * @param array $items + * @param string $method + * @return false|string + */ + static function wss_json($action, $code=200, $msg='ok', $items=[]){ + $json = [ + 'action'=>$action,//响应业务标识 + 'code'=>$code,//错误码 + 'msg'=>$msg,//错误消息 + 'items'=>$items//返回数据 + ]; + return json_encode($json, JSON_UNESCAPED_UNICODE); + } + /** + * desc:成功结果封装 + * + * socket专用json格式 + * + * author:wh + * @param $action + * @param string $msg + * @param array $items + * @param string $method + * @return false|string + */ + static function wss_json_ok($action, $msg='ok', $items=[]){ + $json = [ + 'action'=>$action,//响应业务标识 + 'code'=>200,//错误码 + 'msg'=>$msg,//错误消息 + 'items'=>$items//返回数据 + ]; + return json_encode($json, JSON_UNESCAPED_UNICODE); + } + /** + * desc:失败结果封装 + * + * socket专用json格式 + * + * author:wh + * @param $action + * @param string $msg + * @param array $items + * @param string $method + * @return false|string + */ + static function wss_json_fail($action, $msg='操作失败.', $items=[]){ + $json = [ + 'action'=>$action,//响应业务标识 + 'code'=>500,//错误码 + 'msg'=>$msg,//错误消息 + 'items'=>$items//返回数据 + ]; + return json_encode($json, JSON_UNESCAPED_UNICODE); + } /** * desc:获取框架版本[兼容各个ThinkPHP框架] *