diff --git a/superadmin/vendor/wanghua/general-utility-tools-php b/superadmin/vendor/wanghua/general-utility-tools-php
deleted file mode 160000
index a64ab59..0000000
--- a/superadmin/vendor/wanghua/general-utility-tools-php
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a64ab59e2d4cbc1bacfb0baf18f8d3d6f21f28ac
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/README.en.md b/superadmin/vendor/wanghua/general-utility-tools-php/README.en.md
new file mode 100644
index 0000000..4c9c21a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/README.en.md
@@ -0,0 +1,37 @@
+# general_utility_tools_php
+
+#### Description
+php常用工具箱
+general utility tool for php
+
+#### Software Architecture
+Software architecture description
+
+#### Installation
+
+1. xxxx
+2. xxxx
+3. xxxx
+
+#### Instructions
+
+1. xxxx
+2. xxxx
+3. xxxx
+
+#### Contribution
+
+1. Fork the repository
+2. Create Feat_xxx branch
+3. Commit your code
+4. Create Pull Request
+
+
+#### Gitee Feature
+
+1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
+2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
+3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
+4. The most valuable open source project [GVP](https://gitee.com/gvp)
+5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
+6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/README.md b/superadmin/vendor/wanghua/general-utility-tools-php/README.md
new file mode 100644
index 0000000..f1bee76
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/README.md
@@ -0,0 +1,142 @@
+# general_utility_tools_php
+
+#### 介绍
+
+[PHP常用通用工具库]
+
+一、常用验证类库
+1. 验证手机号是否正确
+2. 验证邮箱
+3. 验证身份证号码
+4. 是否字母或数字
+5. 是否是小数格式
+6. 更多功能请参考代码
+
+二、PHP日期处理工具
+1. 日期加上N年、月、日、时、分、秒,得到计算后的时间
+2. 两个日期相减得到天、时、分、秒(没有两个日期相加一说)
+3. 更多更完善功能敬请期待......
+
+三、更多类库参考本类库目录
+1. 每个目录都有使用说明.
+
+#### 软件架构
+
+每一种工具独立为一个功能类库。
+#### 软件要求
+ thinkphp5.0+,PHP7.1+
+
+
+#### 安装教程
+ composer require wanghua/general-utility-tools-php dev-master
+
+###### 注意:如果总是安装失败,可切换国内或者国外源;如果是找不到版本则加上dev-master尝试
+###### 注意:如果总是安装失败,可卸载此包重新安装,卸载指令:composer remove wanghua/general-utility-tools-php
+###### 注意:如果总是不能提交 vendor下面的一个文件夹(或文件),请参考这篇文章解决:https://blog.csdn.net/qq_15941409/article/details/113184021
+
+### 一、常用验证类库使用说明
+##### 初始化
+
+ //静态方法无需实例化直接调用
+
+##### 验证参数是否是小数格式
+ $str = '1.223';
+ var_dump(Validate::is_float_number($str));
+
+##### 验证参数是否字母或数字
+ $str = 'qwer#199';
+ var_dump(Validate::is_letter_or_number($str));
+
+###### 注: 更多功能请参考源码
+
+### 二、PHP日期处理工具使用说明
+
+##### 初始化
+ $date = (new Date());
+ $date->date_format = 'Y-m-d H:i:s';//设置格式,默认Y-m-d H:i:s
+
+##### 日期类型参数(第2个参数)可选项:
+ //分、时、天、周、月、年
+ protected $data_type = [
+ 'm' =>'minute',//分钟
+ 'minute' =>'minute',//分钟
+ 'h' =>'hour',//小时
+ 'hour' =>'hour',//小时
+ 'd' =>'day',//天
+ 'day' =>'day',//天
+ 'w' =>'week',//周
+ 'week' =>'week',//周
+ 'M' =>'month',//月
+ 'month' =>'month',//月
+ 'y' =>'year',//年
+ 'year' =>'year',//年
+ ];
+
+
+##### 在当前时间基础上加3天(第三个参数不传默认使用当前时间)
+ $res = $date->addTime(3, 'd');//支持单词和字母,例如:d表示天,day也表示天
+ dump($res);
+
+##### 在当前时间基础上加1小时(第三个参数不传默认使用当前时间)
+ $res = $date->addTime(1, 'h');//支持单词和字母,例如:h表示小时,hour也表示小时
+ dump($res);
+
+##### 在指定时间基础上加1小时
+ $res = $date->addTime(1, 'h', strtotime('2010-10-01 12:00:10'));
+ dump($res);
+
+##### 在指定时间基础上减1个月 (注意:月是大写M字母,分钟是小写m字母)
+ $res = $date->reduceTime(1, 'M', strtotime('2010-10-01 12:00:10'));
+ dump($res);
+
+##### 在指定时间基础上减20分钟 (注意:分钟是小写m字母)
+ $res = $date->reduceTime(20, 'm', strtotime('2010-10-01 12:00:10'));
+ dump($res);
+
+##### 在指定时间基础上减1年
+ $res = $date->reduceTime(1, 'y', strtotime('2010-10-01 12:00:10'));
+ dump($res);
+
+### 日期时间相减
+
+ //时间相减返回的时间类型 秒、分、时、天 默认返回秒
+ protected $time_type = [
+ 's' =>1,//秒
+ 'second' =>1,//秒
+ 'm' =>60,//分钟
+ 'minute' =>60,//分钟
+ 'h' =>3600,//小时
+ 'hour' =>3600,//小时
+ 'd' =>86400,//天
+ 'day' =>86400,//天
+ ];
+
+ $start_time = '2010-05-01 12:30:00';
+ $end_time = '2010-10-28 12:30:00';
+
+ //结束时间减去开始时间得到秒数 (返回类型参考上方配置)
+ $res = $date->timeReduceTime($end_time, $start_time);
+ dump($res);
+
+ //结束时间减去开始时间得到天数 (返回类型参考上方配置)
+ $res = $date->timeReduceTime($end_time, $start_time, 'day');
+ dump($res);
+
+###### 注: 更多功能请参考源码
+
+#### 参与贡献
+
+1. Fork 本仓库
+2. 新建 Feat_xxx 分支
+3. 提交代码
+4. 新建 Pull Request
+
+
+#### 特技
+
+1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
+2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
+3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
+4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
+5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
+6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/composer.json b/superadmin/vendor/wanghua/general-utility-tools-php/composer.json
new file mode 100644
index 0000000..510c7cb
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/composer.json
@@ -0,0 +1,25 @@
+{
+ "type": "library",
+ "name": "wanghua/general-utility-tools-php",
+ "homepage": "https://gitee.com/drop_drop/general_utility_tools_php.git",
+ "description": "general utility tools for thinkPHP",
+ "license": "Apache-2.0",
+ "version":"1.0.1",
+ "keywords": ["general-utility-tools","php tool","common tool"],
+ "authors": [
+ {
+ "name": "wanghua",
+ "email": "wanghua@qq.com",
+ "homepage": "https://blog.csdn.net/qq_15941409"
+ }
+ ],
+ "minimum-stability": "stable",
+ "require": {
+ "ext-json": "*"
+ },
+ "autoload": {
+ "psr-4": {
+ "wanghua\\general_utility_tools_php\\": "src/"
+ }
+ }
+}
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/Date.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/Date.php
new file mode 100644
index 0000000..072cfb9
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/Date.php
@@ -0,0 +1,396 @@
+'minute',//分钟
+ 'minute' =>'minute',//分钟
+ 'h' =>'hour',//小时
+ 'hour' =>'hour',//小时
+ 'd' =>'day',//天
+ 'day' =>'day',//天
+ 'w' =>'week',//周
+ 'week' =>'week',//周
+ 'M' =>'month',//月
+ 'month' =>'month',//月
+ 'y' =>'year',//年
+ 'year' =>'year',//年
+ ];
+ //秒、分、时、天
+ protected $time_type = [
+ 's' =>1,//秒
+ 'second' =>1,//秒
+ 'm' =>60,//分钟
+ 'minute' =>60,//分钟
+ 'h' =>3600,//小时
+ 'hour' =>3600,//小时
+ 'd' =>86400,//天
+ 'day' =>86400,//天
+ ];
+ /**
+ * desc:日期时间加N
+ *
+ * 【注意】
+ * 请在计算月时使用$date->date_format = 'Y-m'防止跳月份
+ * 例如:2020-03-31月基础上加一个月,在默认$date->date_format='Y-m-d H:i:s'时,会跳到2020-05-01
+ *
+ * author:wh
+ * @param int $times 相加的时间数量 整型
+ * @param string $date_type 要相加的时间类型 可选值:m 分钟;h 小时;d 天;w 周;M 月;y 年
+ * @param int $default_time 时间戳,默认当前时间
+ * @return false|string 返回$this->date_format格式,可根据需要设定格式
+ */
+ function addTime(int $times, string $date_type, int $default_time=0){
+ return date($this->date_format, strtotime("+{$times} {$this->data_type[$date_type]}", $default_time?$default_time:time()));
+ }
+
+ /**
+ * desc:日期时间减N
+ *
+ * 【注意】
+ * 请在计算月时使用$date->date_format = 'Y-m'防止跳月份
+ * 例如:2020-03-31月基础上加一个月,在默认$date->date_format='Y-m-d H:i:s'时,会跳到2020-05-01
+ *
+ * author:wh
+ * @param int $times 减去的时间数量 整型
+ * @param string $date_type 要相减的时间类型 可选值:m 分钟;h 小时;d 天;w 周;M 月;y 年
+ * @param int $default_time 时间戳,默认当前时间
+ * @return false|string 返回$this->date_format格式,可根据需要设定格式
+ */
+ function reduceTime(int $times, string $date_type, int $default_time=0){
+ return date($this->date_format, strtotime("-{$times} {$this->data_type[$date_type]}", $default_time?$default_time:time()));
+ }
+
+ /**
+ * desc:日期时间相减,通常结束时间大于开始时间
+ * author:wh
+ * @param string $end_time 结束时间
+ * @param string $start_time 开始时间
+ * @param string $return_type 日期时间相减后得到的时间类型,可能是小数。可选值:s 秒;m 分钟;h 小时;d;天
+ * @return float|int 返回计算后的天、时、分、秒数
+ */
+ function timeReduceTime(string $end_time, string $start_time, string $return_type='s'){
+ return (strtotime($end_time) - strtotime($start_time)) / $this->time_type[$return_type];
+ }
+
+ /**
+ * desc:日期减日期, 返回月数或年数
+ *
+ * author:wh
+ * @param string $start_time 开始时间
+ * @param string $end_time 结束时间
+ * @param string $return_type M 返回一共有多少个月,y 返回有多少个年
+ * @return float|int
+ */
+ function dateCutDate(string $start_time, string $end_time, string $return_type='M'){
+ $e = date_create($end_time);
+
+ $s = date_create($start_time);
+
+ $diff = date_diff($e, $s);
+
+ //计算月份
+ if ($diff->y > 0) {
+ $m = $diff->y * 12 + $diff->m;
+ }else{
+ $m = $diff->m;
+ }
+ return $return_type=='M'?$m:$diff->y;
+ }
+
+ /**
+ * desc:日期相减得到月数
+ * 注意:不是计算的时间戳,而是计算的月份差值
+ * author:wh
+ * @param string $start_time
+ * @param string $end_time
+ * @return false|float|int|string
+ */
+ function dateCutMonth(string $start_time, string $end_time){
+ $start_y = date('Y', strtotime($start_time));
+ $end_y = date('Y', strtotime($end_time));
+ $start_m = date('m', strtotime($start_time));
+ $end_m = date('m', strtotime($end_time));
+ $ym = ($end_y-$start_y) * 12;
+ return $ym - $start_m + $end_m;
+ }
+ /**
+ * desc:日期相减得到年数
+ * 注意:不是计算的时间戳,而是计算的年份差值
+ * author:wh
+ * @param string $start_time
+ * @param string $end_time
+ * @return false|float|int|string
+ */
+ function dateCutYear(string $start_time, string $end_time){
+ $start_y = date('Y', strtotime($start_time));
+ $end_y = date('Y', strtotime($end_time));
+ return ($end_y-$start_y) * 12;
+ }
+ /**
+ * desc:返回年中第几天
+ * author:wh
+ * @param string $month 指定月份
+ * @param string $day 指定日
+ * @param string $year 指定年份
+ * @return false|string
+ */
+ function get_day_Year(string $month, string $day, string $year){
+ return date('z',mktime(0,0,0,$month,$day,$year));
+ }
+
+ /**
+ * desc:今天的开始时间
+ * author:wh
+ * @return false|string
+ */
+ function beginToday(){
+ return date('Y-m-d').' 00:00:00';
+ }
+ /**
+ * desc:今天的结束时间
+ * author:wh
+ * @return false|string
+ */
+ function endToday(){
+ return date('Y-m-d').' 23:59:59';
+ }
+
+ /**
+ * desc:昨天的开始时间
+ * author:wh
+ * @return string
+ */
+ function beginYesterday(){
+ return date('Y-m-d', strtotime('-1 day')).' 00:00:00';
+ }
+
+ /**
+ * desc:昨天的结束时间
+ * author:wh
+ * @return string
+ */
+ function endYesterday(){
+ return date('Y-m-d', strtotime('-1 day')).' 23:59:59';
+ }
+
+ /**
+ * desc:前天的开始时间
+ * author:wh
+ * @return string
+ */
+ function beginBeforeYesterday(){
+ return date('Y-m-d', strtotime('-2 day')).' 00:00:00';
+ }
+
+ /**
+ * desc:前天的结束时间
+ * author:wh
+ * @return string
+ */
+ function endBeforeYesterday(){
+ return date('Y-m-d', strtotime('-2 day')).' 23:59:59';
+ }
+
+ /**
+ * 本周的开始日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function beginWeek($His = true)
+ {
+ //此代码会跳周、月、年
+ //$timestamp = mktime(0, 0, 0, date('m'), date('d') - date('w') + 1, date('Y'));
+ //return $His ? date('Y-m-d H:i:s', $timestamp) : date('Y-m-d', $timestamp);
+
+ //改进
+ //$first =1 表示每周星期一为开始日期 0表示每周日为开始日期
+ $first=1;
+ $sdefaultDate = date("Y-m-d");
+ //获取当前周的第几天 周日是 0 周一到周六是 1 - 6
+ $w=date('w',strtotime($sdefaultDate));
+ //是否展示时分秒
+ $week_start = date('Y-m-d',strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'));
+ //是否展示时分秒
+ if($His){
+ //$week_start
+ return $week_start.' 00:00:00';
+ }
+ //$week_start
+ return $week_start;
+ }
+
+ /**
+ * 本周的结束日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function endWeek($His = true)
+ {
+ //此代码会跳周、月、年
+ //$timestamp = mktime(23, 59, 59, date('m'), date('d') - date('w') + 7, date('Y'));
+ //return $His ? date('Y-m-d H:i:s', $timestamp) : date('Y-m-d', $timestamp);
+
+ //改进
+ //$first =1 表示每周星期一为开始日期 0表示每周日为开始日期
+ $first=1;
+ $sdefaultDate = date("Y-m-d");
+ //获取当前周的第几天 周日是 0 周一到周六是 1 - 6
+ $w=date('w',strtotime($sdefaultDate));
+ //是否展示时分秒
+ $week_start = date('Y-m-d',strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'));
+ $week_end=date('Y-m-d',strtotime("$week_start +6 days"));
+ //是否展示时分秒
+ return $His?$week_end.' 23:59:59':$week_end;
+ }
+
+ /**
+ * desc:上周开始
+ * author:wh
+ * @return false|string
+ */
+ function beginBeforeWeek(){
+ $week = $this->beginWeek();
+ $this->date_format = 'Y-m-d';
+ return $this->reduceTime(7,'d',strtotime($week)) . ' 00:00:00';
+
+ //此代码会跳周、月、年
+ //return date('Y-m-d', strtotime('-1 monday', time())).' 00:00:00';//上周一,无论今天几号,-1 monday为上一个有效周未
+ }
+
+ /**
+ * desc:上周结束
+ * author:wh
+ * @return false|string
+ */
+ function endBeforeWeek(){
+
+ $week = $this->beginWeek();
+ $this->date_format = 'Y-m-d';
+ return $this->reduceTime(1,'d',strtotime($week)) . ' 23:59:59';
+
+ //此代码会跳周、月、年
+ //return date('Y-m-d', strtotime('-1 sunday', time())).' 23:59:59'; //上一个有效周日,同样适用于其它星期
+ }
+
+ /**
+ * 本月的开始日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function beginMonth($His = true)
+ {
+ return $His ? date('Y-m-').'01 00:00:00' : date('Y-m-').'01';
+ }
+ /**
+ * 本月的结束日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function endMonth($His = true)
+ {
+ $timestamp = mktime(23, 59, 59, date('m'), date('t'), date('Y'));
+ return $His ? date('Y-m-d H:i:s', $timestamp) : date('Y-m-d', $timestamp);
+ }
+
+ /**
+ * desc:上月开始时间(上月一日)
+ * author:wh
+ * @return false|string
+ */
+ function beginBeforeMonth(){
+ return date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m', time()) . '-01 00:00:00'))).' 00:00:00'; //本月一日直接strtotime上减一个月
+ }
+ /**
+ * desc:上月结束时间(上月最后一日)
+ * author:wh
+ * @return false|string
+ */
+ function endBeforeMonth(){
+ return date('Y-m-d', strtotime(date('Y-m', time()) . '-01 00:00:00') - 86400).' 23:59:59'; //本月一日减一天即是上月最后一日
+ }
+
+ /**
+ * desc:七天(一周)以内
+ * author:wh
+ * @return false|string
+ */
+ function innerWeekDay(){
+ $time = time();
+ //当前时间减去30天
+ $second = $time - 7 * 86400;
+ return date('Y-m-d', $second);
+ }
+ /**
+ * desc:一月以内
+ * author:wh
+ * @return false|string
+ */
+ function innerMonth(){
+ $time = time();
+ //当前时间减去30天
+ $second = $time - 30 * 86400;
+ return date('Y-m-d', $second);
+ }
+ /**
+ * desc:一年以内
+ * author:wh
+ * @return false|string
+ */
+ function innerYear(){
+ $time = time();
+ //当前时间减去30天
+ $second = $time - 365 * 86400;
+ return date('Y-m-d', $second);
+ }
+
+ /**
+ * 几年的开始日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function beginYear($His = true)
+ {
+ $timestamp = date('Y');
+ return $His ? $timestamp.'-01-01 00:00:00' : $timestamp.'-01-01';
+ }
+
+ /**
+ * 几年的结束日期
+ *
+ * @param bool $His 是否展示时分秒 默认true
+ *
+ * @return false|string
+ */
+ function endYear($His = true)
+ {
+ $timestamp = date('Y');
+ return $His ? $timestamp.'-12-31 23:59:59' : $timestamp.'-12-31';
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/Mmodel.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/Mmodel.php
new file mode 100644
index 0000000..fd27413
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/Mmodel.php
@@ -0,0 +1,134 @@
+insertGetId($data);
+ }
+ $res = Db::table($table)
+ ->where($where)
+ ->find();
+ if($res){
+ //不修改条件数据
+ $data = array_diff_key($data,$where);//从data中删除where数组中的键值对
+
+ Db::table($table)
+ ->where($where)
+ ->data($data)
+ ->update();
+ return $res['id'];
+ }
+ return Db::table($table)->insertGetId($data);
+ }
+
+
+ /**
+ * desc:捕获式函数块
+ *
+ * 无事务处理
+ *
+ * author:wh
+ * @param $fn
+ */
+ static function catch($fn){
+ try{
+ //不输出日志,此代码块可能用于内部逻辑
+ //Tools::log_to_write_txt(['input'=>input()]);
+ $res = $fn();
+ //Tools::log_to_write_txt(['output'=>$res]);
+ return $res;
+ }catch (\Exception $e){
+ Tools::error_txt_log($e);
+ return Tools::set_fail('操作失败.',$e->getMessage());
+ }
+ }
+ /**
+ * desc:捕获式函数块
+ *
+ * 无事务处理
+ *
+ * author:wh
+ * @param $fn
+ */
+ static function catchJson($fn, $is_whrite_log=true){
+ try{
+ !$is_whrite_log?:Tools::log_to_write_txt(['input'=>input()]);
+ $res = $fn();
+ !$is_whrite_log?:Tools::log_to_write_txt(['output'=>$res]);
+ return json($res);
+ }catch (\Exception $e){
+ Tools::error_txt_log($e);
+ return json(Tools::set_fail('操作失败.',$e->getMessage()));
+ }
+ }
+ /**
+ * desc:捕获式函数块
+ *
+ * 自动事务处理
+ *
+ * author:wh
+ * @param $fn
+ */
+ static function catchTrans($fn, $is_whrite_log=true){
+ Db::startTrans();
+ try{
+ !$is_whrite_log?:Tools::log_to_write_txt(['input'=>input()]);
+ $res = $fn();
+ !$is_whrite_log?:Tools::log_to_write_txt(['output'=>$res]);
+ Db::commit();
+ return $res;
+ }catch (\Exception $e){
+ Db::rollback();
+ Tools::error_txt_log($e);
+ return Tools::set_fail('操作失败.',$e->getMessage());
+ }
+ }
+ /**
+ * desc:捕获式函数块
+ *
+ * 自动事务处理
+ *
+ * author:wh
+ * @param $fn
+ */
+ static function catchTransJson($fn, $is_whrite_log=true){
+ Db::startTrans();
+ try{
+ !$is_whrite_log?:Tools::log_to_write_txt(['input'=>input()]);
+ $res = $fn();
+ !$is_whrite_log?:Tools::log_to_write_txt(['output'=>$res]);
+ Db::commit();
+ return json($res);
+ }catch (\Exception $e){
+ Db::rollback();
+ Tools::error_txt_log($e);
+ return json(Tools::set_fail('操作失败.',$e->getMessage()));
+ }
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/PinYin.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/PinYin.php
new file mode 100644
index 0000000..91b032a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/PinYin.php
@@ -0,0 +1,94 @@
+where('key',$key);
+ $obj->data(['val'=>$val]);
+ return $obj->update();
+ }
+ $obj = Db::table($tabname);
+ return $obj->where(['key'=>$key])
+ ->cache($tabname.'_'.$key,0,$tabname)
+ ->value('val');
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/Validate.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/Validate.php
new file mode 100644
index 0000000..14e9507
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/Validate.php
@@ -0,0 +1,360 @@
+2){
+ //返回false,表示非严格的2位数金额
+ return false;
+ }
+
+
+ return $r;
+ }
+
+ /**
+ * desc:是否是小数格式
+ * author:wh
+ * @param string $num
+ * @return bool
+ */
+ static function is_float_number(string $num){
+ return preg_match('/^[0-9]+.[0-9]+$/', $num)?true:false;
+ }
+
+ /**
+ * desc:是否是数字
+ * author:wh
+ * @param string $num
+ * @return bool
+ */
+ static function is_number(string $num){
+ return preg_match('/^\d+$/', $num)?true:false;
+ }
+
+ /**
+ * desc:是否是字母
+ * author: wh
+ * @param string $str
+ * @return bool
+ */
+ static function is_letter(string $str){
+ return preg_match('/^[a-zA-Z]+$/', $str) ? true : false;
+ }
+
+ /**
+ * desc:是否字母或数字
+ * author:wh
+ * @param string $str
+ * @return bool
+ */
+ static function is_letter_or_number(string $str){
+ return preg_match('/^[a-zA-Z|0-9]+$/', $str) ? true : false;
+ }
+
+ /**
+ * desc:验证数组是否存在空值
+ * 仅针对基本数据类型
+ * 仅针对一维数组
+ * author:wh
+ * @param $array
+ * @return bool
+ */
+ static function check_array_val_empty($array){
+ $is_empty = false;
+ foreach ($array as $value){
+ if(($value!==0 && $value !=='0') && empty($value)){
+ $is_empty = true;
+ break;
+ }
+ if(is_int($value) && empty(1*$value)){
+ $is_empty = true;
+ break;
+ }
+ }
+ return $is_empty;
+ }
+
+ /**
+ * desc:是否是url
+ * author:wh
+ * @param $v
+ * @return bool
+ */
+ static function is_url($v){
+ $pattern="#(http|https)://(.*\.)?.*\..*#i";
+ return preg_match($pattern,$v)?true:false;
+ }
+
+
+ /**
+ * [是否全部大写]
+ *
+ * @param $str
+ * @return bool
+ * @example
+ * @see
+ * @link
+ */
+ static function is_upper($str){
+ return preg_match('/^[A-Z]+$/', $str)?true:false;
+ }
+
+ /**
+ * [是否全部小写]
+ *
+ * @param $str
+ * @return bool
+ * @example
+ * @see
+ * @link
+ */
+ static function is_lower($str){
+ return preg_match('/^[a-z]+$/', $str)?true:false;
+ }
+
+
+ /**
+ * desc:验证是微信内还是微信外
+ *
+ * 是否在微信内,是否在微信中
+ *
+ * author:wh
+ * @return bool
+ */
+ static function is_weixin(){
+ return strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false;
+ }
+
+ /**
+ * desc:是否包含特殊字符
+ * author:wh
+ * @param string $str
+ * @return bool
+ */
+ static function is_special_character(string $str){
+ $res = preg_match ( '/[\Q~!@#$%^&*()+-_=.:?<>\E]/', $str );
+ return $res ? true : false;
+ }
+
+ /**
+ * desc:验证字符串是否全部是中文
+ *
+ * 返回 true表示全部是中文,false表示部分是中文或没有中文
+ *
+ * author:wh
+ * @param string $str
+ * @return bool
+ */
+ static function is_all_chinese(string $str){
+ return preg_match("/^[\x{4e00}-\x{9fa5}]+$/u",$str)?true:false;
+ }
+
+ /**
+ * desc:验证两个浮点数值是否相等
+ *
+ * 例如:
+ * $num1 = 0.1;
+ $num2 = 0.7;
+
+ $res = $num1 + $num2;
+
+ var_dump($res);
+
+ var_dump($res == 0.8);//false 不相等
+
+ var_dump(intval(strval($res)) == intval(strval(0.8)));//true 相等
+ *
+ * author:wh
+ * @param $float_num1
+ * @param $float_num2
+ * @return bool
+ */
+ static function is_equal_num_val($float_num1, $float_num2){
+
+ return intval(strval($float_num1)) == intval(strval($float_num2));
+ }
+
+ /**
+ * desc:是否包含给定的主域名
+ * author:wh
+ * @param $domain
+ * @param $main_domain
+ * @return bool
+ */
+ static function is_main_domain($domain,$main_domain){
+ $exp_arr = explode('.',$domain);
+ $str = $exp_arr[count($exp_arr)-2] .'.'. $exp_arr[count($exp_arr)-1];
+ return $str==$main_domain;
+ }
+
+ /**
+ * desc:国内国外IP校验,校验IP来源
+ *
+ * author:wh
+ * @param $ip
+ * @return bool
+ */
+ static function validate_ip($ip) {
+ $chinaStart = ip2long('1.0.1.0'); // 中国大陆起始IP
+ $chinaEnd = ip2long('254.254.254.254'); // 中国大陆结束IP
+
+ $hongKongStart = ip2long('8.36.0.0'); // 香港起始IP
+ $hongKongEnd = ip2long('8.37.255.255'); // 香港结束IP
+
+ $taiwanStart = ip2long('192.168.0.0'); // 台湾起始IP
+ $taiwanEnd = ip2long('192.168.255.255'); // 台湾结束IP
+
+ $ipLong = ip2long($ip);
+
+ if ($ipLong >= $chinaStart && $ipLong <= $chinaEnd ||
+ $ipLong >= $hongKongStart && $ipLong <= $hongKongEnd ||
+ $ipLong >= $taiwanStart && $ipLong <= $taiwanEnd) {
+ return true; // IP属于国内
+ } else {
+ return false; // IP不属于国内
+ }
+ }
+
+
+ /**
+ * 是否移动端访问访问
+ *
+ * @return bool
+ */
+ static function is_mobile_client()
+ {
+ // 如果有HTTP_X_WAP_PROFILE则一定是移动设备
+ if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
+ return true;
+ }
+
+//如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
+ if (isset($_SERVER['HTTP_VIA'])) {
+ //找不到为flase,否则为true
+ return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;
+ }
+
+//判断手机发送的客户端标志
+ if (isset($_SERVER['HTTP_USER_AGENT'])) {
+ $clientkeywords = [
+ 'nokia', 'sony', 'ericsson', 'mot', 'samsung', 'htc', 'sgh', 'lg', 'sharp',
+ 'sie-', 'philips', 'panasonic', 'alcatel', 'lenovo', 'iphone', 'ipod', 'blackberry', 'meizu',
+ 'android', 'netfront', 'symbian', 'ucweb', 'windowsce', 'palm', 'operamini', 'operamobi',
+ 'openwave', 'nexusone', 'cldc', 'midp', 'wap', 'mobile','alipay'
+ ];
+
+// 从HTTP_USER_AGENT中查找手机浏览器的关键字
+ if (preg_match("/(".implode('|', $clientkeywords).")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
+ return true;
+ }
+ }
+
+//协议法,因为有可能不准确,放到最后判断
+ if (isset($_SERVER['HTTP_ACCEPT'])) {
+ // 如果只支持wml并且不支持html那一定是移动设备
+ // 如果支持wml和html但是wml在html之前则是移动设备
+ if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * 判断是否微信内置浏览器访问
+ * @return bool
+ */
+ static function is_wx_client()
+ {
+ return strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false;
+ }
+
+ /**
+ * 判断是否支付宝内置浏览器访问
+ * @return bool
+ */
+ static function is_ali_client()
+ {
+ return strpos($_SERVER['HTTP_USER_AGENT'], 'Alipay') !== false;
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/Algorithm.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/Algorithm.php
new file mode 100644
index 0000000..493b70a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/Algorithm.php
@@ -0,0 +1,121 @@
+ $weight) {
+ $cumulativeWeight += $weight; // 累加权重
+ if ($random <= $cumulativeWeight) {
+ $selected = $index; // 根据权重选择索引
+ break;
+ }
+ }
+ //输出选择的索引
+ return $selected;
+ }
+
+ /**
+ * desc:测试权重随机算法概率
+ * author:wh
+ * @param array $weights 权重数组 eg:[1, 9, 30, 70]
+ */
+ static function testWeightRandom(array $weights){
+ echo json_encode($weights)."\n";
+
+ $trials = 1000; // 试验次数
+ $selectionCounts = array_fill(0, count($weights), 0); // 用于存储每个索引的选择次数
+
+ for ($i = 0; $i < $trials; $i++) {
+
+ $index = self::weightRandom($weights);
+ $selectionCounts[$index]++; // 记录选择次数
+ }
+
+ // 计算每个索引的选择概率
+ $probabilities = [];
+ foreach ($selectionCounts as $index => $count) {
+ $probabilities[$index] = ($count / $trials) * 100; // 转换为百分比
+ }
+
+ // 输出结果
+ echo "After {$trials} trials, the probabilities of selecting each index are:\n";
+ foreach ($probabilities as $index => $probability) {
+ echo "Index {$index}: {$probability}%\n";
+ }
+ }
+
+ /**
+ * desc:洗牌算法
+ *
+ * 对数组进行随机排序,实现洗牌算法
+ * author:wh
+ * @param array $items eg: [1, 2, 3, 4, 5]
+ * @return array 返回计算后的数组
+ */
+ static function shuffle(array $items) {
+ //$items = [1, 2, 3, 4, 5];
+ shuffle($items);
+ return $items;
+ }
+
+ /**
+ * 随机密码生成算法
+ *
+ * 作用:创建安全的随机密码,常用于用户注册或密码重置
+ * 使用场景:用户账户创建、密码重置链接生成
+ */
+ static function randomPassword($length = 8) {
+ $password = '';
+ $possibleChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+
+ for ($i = 0; $i < $length; $i++) {
+ $password .= substr($possibleChars, mt_rand(0, strlen($possibleChars) - 1), 1);
+ }
+ return $password;
+ }
+
+ /**
+ * 随机颜色生成算法
+ *
+ * 作用:生成随机RGB颜色值,可用于网页设计中动态改变元素颜色
+ * 使用场景:动态网页背景、随机颜色显示的元素
+ */
+ static function randomColor() {
+ $red = mt_rand(0, 255);
+ $green = mt_rand(0, 255);
+ $blue = mt_rand(0, 255);
+ return [$red, $green, $blue];
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/AlgorithmTest.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/AlgorithmTest.php
new file mode 100644
index 0000000..9c61338
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/AlgorithmTest.php
@@ -0,0 +1,52 @@
+ $count) {
+ $probabilities[$index] = ($count / $trials) * 100; // 转换为百分比
+ }
+
+ // 输出结果
+ echo "After {$trials} trials, the probabilities of selecting each index are:\n";
+ foreach ($probabilities as $index => $probability) {
+ echo "Index {$index}: {$probability}%\n";
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/README.MD b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/README.MD
new file mode 100644
index 0000000..2411941
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/algorithm/README.MD
@@ -0,0 +1 @@
+## 常见实用算法
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php
new file mode 100644
index 0000000..67f760a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/AlibabaAuth.php
@@ -0,0 +1,162 @@
+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);
+ $this->request_body = $url;
+ $res = Curl::curl_post($url,[]);
+ return $res;
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/BaseStrict.php
new file mode 100644
index 0000000..1c921cb
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/README.MD
new file mode 100644
index 0000000..d187b94
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php
new file mode 100644
index 0000000..6eddd6a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/Testexample.php
@@ -0,0 +1,158 @@
+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 queryOrderPayChannel($order_id){
+ $config = config('meebo_supply_config');
+ $authObj = new AlibabaAuth($config);
+ $order = new StrictPay($authObj);
+ return $order->queryOrderPayChannel($order_id);
+ }
+ //组合收银台url获取
+ function getPayUrl(array $orderIds){
+ $config = config('meebo_supply_config');
+ $authObj = new AlibabaAuth($config);
+ $order = new StrictPay($authObj);
+ return $order->getPayUrl($orderIds,'PC');
+ }
+
+ //获取唤起旺旺聊天的链接
+ 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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/Alibaba.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/Alibaba.php
new file mode 100644
index 0000000..dadda46
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/Alibaba.php
@@ -0,0 +1,127 @@
+$message_data]);
+ if(empty($message_data['type'])){
+ return Tools::set_fail('type为空');
+ }
+ //$key = strtolower(explode('_',$message_data['type'])[0]);
+ //获取消息类型
+ $fn = strtolower($message_data['type']);//类型即为方法名
+ //消息类型前缀即为类名
+ $class = '\\app\\index\\logic\\alibabanotify\\'.ucfirst(explode('_',$fn)[0]).'Notify';
+ //实例化类
+ return (new $class())->{$fn}($message_data);//调用方法
+ });
+ }
+
+ /**
+ * desc:ali采购获取临时授权code
+ *
+ * index/alibaba/webAuthCode
+ *
+ * author:wh
+ * @return string
+ */
+ function webAuthCode(){
+
+ $Testexample = new Testexample();
+
+ $res = $Testexample->testWebAuth(request()->domain().'/index/alibaba/webUserAuth');
+ return $res;
+ }
+
+ /**
+ * desc:网页授权,code换取token
+ *
+ * index/alibaba/webUserAuth
+ *
+ * author:wh
+ */
+ function webUserAuth(){
+ $code = input('code');
+ if(empty($code)){
+ return $this->error('授权失败');
+ }
+
+ $redirect_uri = url('test/test2');
+ $Testexample = new Testexample();
+ $res = $Testexample->getTokenByCode($code,$redirect_uri);
+ if($res['code'] != 200){
+ return $this->error('授权失败.'.$res['msg']);
+ }
+ $data = json_decode($res['data']);
+ $auth_data = [
+ 'access_token'=>$data['access_token'],
+ 'aliid'=>$data['aliId'],
+ 'expires_in'=>$data['expires_in'],
+ 'memberid'=>$data['memberId'],
+ 'refresh_token'=>$data['refresh_token'],
+ 'refresh_token_timeout'=>$data['refresh_token_timeout'],
+ 'resource_owner'=>$data['resource_owner'],
+ ];
+ //写入数据库
+ Mmodel::existsUpdateInsert(TabConf::$fa_alibaba_user_auth,['access_token'=>$data['access_token']],$auth_data);
+ return '授权成功';
+ }
+
+ //function getCode(){
+ // return Mmodel::catchJson(function (){
+ // //保存code
+ // $code = input('code');
+ //
+ // });
+ //}
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/BaseAlibabaLogic.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/BaseAlibabaLogic.php
new file mode 100644
index 0000000..78b33b8
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/BaseAlibabaLogic.php
@@ -0,0 +1,18 @@
+$message_data]);
+
+ });
+ }
+ /**
+ * 物流单号修改消息
+ */
+ function logistics_mail_no_change($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/OrderNotify.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/OrderNotify.php
new file mode 100644
index 0000000..efb03e6
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/OrderNotify.php
@@ -0,0 +1,137 @@
+$message_data]);
+
+ });
+ }
+
+ /**
+ * desc:1688交易成功(卖家视角)
+ * author:wh
+ */
+ function order_buyer_view_order_success($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单批量支付状态同步消息
+ */
+ function order_batch_pay($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688交易付款(买家视角)/1688 transaction payment (buyer view)
+ */
+ function order_buyer_view_order_pay($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688卖家关闭订单(买家视角)/seller closing order (buyer view)
+ */
+ function order_buyer_view_order_seller_close($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688修改订单价格(买家视角)/order price modification (buyer view)
+ */
+ function order_buyer_view_order_price_modify($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单发货(买家视角)/1688 order delivery (buyer view)
+ */
+ function order_buyer_view_announce_sendgoods($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单部分发货(买家视角)/Partial delivery of 1688 order (buyer view)
+ */
+ function order_buyer_view_part_part_sendgoods($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 商家修改订单地址(买家视角)
+ */
+ function order_buyer_view_order_seller_modify_adress($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单售中退款(买家视角)
+ */
+ function order_buyer_view_order_buyer_refund_in_sales($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单售后退款(买家视角)
+ */
+ function order_buyer_view_order_refund_after_sales($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688买家关闭订单(买家视角)/buyer closing order (buyer view)
+ */
+ function order_buyer_view_order_buyer_close($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688订单确认收货(买家视角)/order receipt confirmation (buyer view)
+ */
+ function order_buyer_view_order_comfirm_receivegoods($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/ProductNotify.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/ProductNotify.php
new file mode 100644
index 0000000..8524216
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/ProductNotify.php
@@ -0,0 +1,89 @@
+$message_data]);
+
+ });
+ }
+ /**
+ * 1688产品删除(关系用户视角)
+ */
+ function product_relation_view_product_delete($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688产品新增或修改(关系用户视角)
+ */
+ function product_relation_view_product_new_or_modify($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688产品上架(关系用户视角)
+ */
+ function product_relation_view_product_repost($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688商品库存变更消息(关系用户视角)
+ */
+ function product_product_inventory_change($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 精选货源商品下架消息
+ */
+ function product_pft_offer_quit($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 精选货源商品价格变动消息
+ */
+ function product_pft_offer_price_modify($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+ /**
+ * 1688产品下架(关系用户视角)
+ */
+ function product_relation_view_product_expire($message_data){
+ return Mmodel::catch(function ()use($message_data){
+ Tools::log_to_write_txt([__FUNCTION__.'消息入参:'=>$message_data]);
+
+ });
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/README.MD b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/README.MD
new file mode 100644
index 0000000..ef4338e
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/alibabanotify/README.MD
@@ -0,0 +1,18 @@
+## 阿里巴巴开放平台消息通知模板
+
+
+### 特别说明
+#### Alibaba.php是控制器类(复制可用),是消息通道httpCallback的回调地址类文件。
+##### eg:http://www.xxx.com/index/alibaba/notify
+##### 回调地址配置入口:https://open.1688.com/develop/app/detail?spm=a260s.develop-app-list.0.0.4d875bfaS5YzoD&appkey=7571564&appKey=7571564
+进入页面后找到“日常消息测试”按钮,点击后在弹出的界面中进行配置。
+### 文件说明
+#### 按照消息类型前缀分类(复制可用)
+1. 订单相关 OrderNotify.php
+2. 产品相关 ProductNotify.php
+3. 物流相关 LogisticsNotify.php
+4. 售后相关
+
+......以此类推,消息类型的小写就是类的方法名。
+
+这里只是打个样,这几个模板可以直接复制,补充上自己的业务逻辑即可。
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/BaseStrictNotify.php
new file mode 100644
index 0000000..4b28e83
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/notify/ProductNotify.php
new file mode 100644
index 0000000..a2115c2
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/README.MD
new file mode 100644
index 0000000..34ded96
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictCategory.php
new file mode 100644
index 0000000..502717c
--- /dev/null
+++ b/superadmin/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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php
new file mode 100644
index 0000000..10b262e
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictGoods.php
@@ -0,0 +1,164 @@
+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/2/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:[不推荐]分销严选商品详情批量查询
+ *
+ * @param string $itemId 商品列表返回的itemId就是offerId
+ *
+ * doc:https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.fenxiao:alibaba.pifatuan.product.detail.list-1
+ *
+ */
+ function getGoodsDetailV1(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/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php
new file mode 100644
index 0000000..7e1f145
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictLogistics.php
@@ -0,0 +1,52 @@
+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, []);
+ }
+
+ /**
+ * desc: 获取物流公司列表
+ *
+ * 物流公司列表-自联物流
+ *
+ * doc:https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.logistics:alibaba.logistics.OpQueryLogisticCompanyList.offline-1&aopApiCategory=Logistics_NEW
+ * author:wh
+ */
+ function getLogisticsCompanyList(){
+ $urlPath = "param2/1/com.alibaba.logistics/alibaba.logistics.OpQueryLogisticCompanyList.offline/".$this->authObj->config['appkey'];
+
+ return $this->authObj->request($urlPath, []);
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php
new file mode 100644
index 0000000..96c2afd
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictOrder.php
@@ -0,0 +1,437 @@
+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'],
+ 'quantity'=>$buy_num,//$goods['quantity'],//商品数量(计算金额用)
+ ];
+ if(!empty($goods['specid'])){
+ $this->goods['specId'] = $goods['specid'];//商品规格id
+ }
+ }
+
+ /**
+ * desc:设置发票信息
+ * author:wh
+ */
+ function setInvoice(array $invoice){
+ $this->invoice = $invoice;
+ }
+
+ /**
+ * desc:创建分销订单 下单
+ *
+ * 获取订单运费,请调用预览订单接口 alibaba.createOrder.preview
+ *
+ * 【优先推荐】
+ * 优先推荐(适用于大部分场景):如果渠道服务的用户在采购过程中,价格是核心决策点,推荐直接使用接口中的"最优价下单“能力,即在订单预览、下单过程中选择flow为空,1688会在所有买家可下单的流程中选择最优价进行下单;
+ * 如果渠道服务的对象以代发群体为主(例如淘卖),需要依赖包邮服务,在分销严选商品下单时,fow选择【boutiquefenxiao】下单,这样即使在采购多件时依然能够保证包邮、48小时发货、7天无理由以及极速退款服务;
+ * 如果渠道服务对象以批发群体为主(例如跨境),对干是否包,邮的服务不是特别敏感,在分销严选商品下单时,fow选择[boutiquepifa】进行下单,使用该接口时,如果只单笔订单购买一件,依然以包邮价进行下单,在单笔多件时会自动切换为批发价+邮费的模式下单,
+ *
+ * @param $order
+ * @param string $flow 下单时必填 boutiquefenxiao(新分销严选包邮) boutiquepifa(分销批发)
+ * author:wh
+ */
+ function createOrder($order,$flow){
+ 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('交易类型必须');
+ }
+ //由于不同的商品支持的交易方式不同,没有一种交易方式是全局通用的,
+ //所以当前下单可使用的交易方式必须通过下单预览接口的tradeModeNameList获取。
+ $request_data = ['tradeType'=>$this->tradeType];
+
+ //boutiquefenxiao(新分销严选)
+ $request_data['flow'] = $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;
+ }
+
+ /**
+ * 创建订单前预览数据接口
+ *
+ * 【下单的时候flow是必填的。只有在预览的时候不填写flow会返回最优的下单方式】
+ * 【调用预览接口,这个是最准确的。】
+ *
+ * 订单创建只允许购买同一个供应商的商品。
+ * 本接口返回创建订单相关的优惠等信息。
+ * 1、校验商品数据是否允许订购。 2、校验代销关系 3、校验库存、起批量、是否满足混批条件
+ *
+ * doc: https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.createOrder.preview-1&aopApiCategory=trade_new
+ */
+ function previewOrder($flow=''){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.createOrder.preview/".$this->authObj->config['appkey'];
+ $request_data = [];
+ //boutiquefenxiao(新分销严选)
+ $request_data['flow'] = $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;
+ }
+
+ /**
+ * 订单列表查看(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.getBuyerOrderList-1&aopApiCategory=trade_new
+ *
+ */
+ function getOrderList($queryParams=[],$page=1,$pageSize=20){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.getSellerOrderList/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['page'] = $page;
+ $request_data['pageSize'] = $pageSize;
+
+ //业务类型,支持: "cn"(普通订单类型), "ws"(大额批发订单类型), "yp"(普通拿样订单类型), "yf"(一分钱拿样订单类型),
+ // "fs"(倒批(限时折扣)订单类型), "cz"(加工定制订单类型), "ag"(协议采购订单类型), "hp"(伙拼订单类型),
+ // "gc"(国采订单类型), "supply"(供销订单类型), "nyg"(nyg订单类型), "factory"(淘工厂订单类型),
+ // "quick"(快订下单), "xiangpin"(享拼订单), "nest"(采购商城-鸟巢), "f2f"(当面付), "cyfw"(存样服务),
+ // "sp"(代销订单标记), "wg"(微供订单), "factorysamp"(淘工厂打样订单), "factorybig"(淘工厂大货订单)
+ if(isset($queryParams['bizTypes'])){
+ $request_data['bizTypes'] = $queryParams['bizTypes'];
+ }
+ //下单开始时间 20180802211113000+0800
+ if(isset($queryParams['createStartTime'])){
+ $request_data['createStartTime'] = $queryParams['createStartTime'];
+ }
+ //下单结束时间 20180802211113000+0800
+ if(isset($queryParams['createEndTime'])){
+ $request_data['createEndTime'] = $queryParams['createEndTime'];
+ }
+ //是否查询历史订单表,默认查询当前表,即默认值为false
+ if(isset($queryParams['isHis'])){
+ $request_data['isHis'] = $queryParams['isHis'];
+ }
+ //查询修改时间结束 20180802211113000+0800
+ if(isset($queryParams['modifyStartTime'])){
+ $request_data['modifyStartTime'] = $queryParams['modifyStartTime'];
+ }
+ //查询修改时间结束 20180802211113000+0800
+ if(isset($queryParams['modifyEndTime'])){
+ $request_data['modifyEndTime'] = $queryParams['modifyEndTime'];
+ }
+ //订单状态,值有 success, cancel(交易取消,违约金等交割完毕), waitbuyerpay(等待卖家付款),
+ // waitsellersend(等待卖家发货),waitbuyerreceive(等待买家收货 )
+ if(isset($queryParams['orderStatus'])){
+ $request_data['orderStatus'] = $queryParams['orderStatus'];
+ }
+ //查询分页页码,从1开始
+ //if(isset($queryParams['page'])){
+ // $request_data['page'] = $queryParams['page'];
+ //}
+ ////查询的每页的数量 20
+ //if(isset($queryParams['pageSize'])){
+ // $request_data['pageSize'] = $queryParams['pageSize'];
+ //}
+ //退款状态,支持: "waitselleragree"(等待卖家同意), "refundsuccess"(退款成功), "refundclose"(退款关闭),
+ // "waitbuyermodify"(待买家修改), "waitbuyersend"(等待买家退货), "waitsellerreceive"(等待卖家确认收货)
+ if(isset($queryParams['refundStatus'])){
+ $request_data['refundStatus'] = $queryParams['refundStatus'];
+ }
+ //卖家memberId b2b-1624961198
+ if(isset($queryParams['sellerMemberId'])){
+ $request_data['sellerMemberId'] = $queryParams['sellerMemberId'];
+ }
+ //卖家loginId alitestforisv02
+ if(isset($queryParams['sellerLoginId'])){
+ $request_data['sellerLoginId'] = $queryParams['sellerLoginId'];
+ }
+ //卖家评价状态 (4:已评价,5:未评价,6;不需要评价)
+ if(isset($queryParams['sellerRateStatus'])){
+ $request_data['sellerRateStatus'] = $queryParams['sellerRateStatus'];
+ }
+ //交易类型: 担保交易(1), 预存款交易(2), ETC境外收单交易(3), 即时到帐交易(4), 保障金安全交易(5), 统一交易流程(6),
+ // 分阶段交易(7), 货到付款交易(8), 信用凭证支付交易(9), 账期支付交易(10), 1688交易4.0,新分阶段交易(50060),
+ // 当面付的交易流程(50070), 服务类的交易流程(50080)
+ if(isset($queryParams['tradeType'])){
+ $request_data['tradeType'] = $queryParams['tradeType'];
+ }
+ //商品名称
+ if(isset($queryParams['productName'])){
+ $request_data['productName'] = $queryParams['productName'];
+ }
+ //是否需要查询买家的详细地址信息和电话 false
+ if(isset($queryParams['needBuyerAddressAndPhone'])){
+ $request_data['needBuyerAddressAndPhone'] = $queryParams['needBuyerAddressAndPhone'];
+ }
+ //是否需要查询备注信息 false
+ if(isset($queryParams['needMemoInfo'])){
+ $request_data['needMemoInfo'] = $queryParams['needMemoInfo'];
+ }
+ //外部订单号,可用于控制幂等 90187872898371
+ if(isset($queryParams['outOrderId'])){
+ $request_data['outOrderId'] = $queryParams['outOrderId'];
+ }
+
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+ /**
+ * 订单详情查看(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.get.buyerView-1&aopApiCategory=trade_new
+ */
+ function getBuyerView(int $orderId,$webSite='1688',$includeFields='',$attributeKeys='',$outOrderId=''){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.get.buyerView/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderId'] = $orderId;//交易的订单id 1234345
+ $request_data['webSite'] = $webSite;//站点信息,指定调用的API是属于国际站(alibaba)还是1688网站(1688)
+ $request_data['includeFields'] = $includeFields;//查询结果中包含的域,GuaranteesTerms:保障条款,NativeLogistics:物流信息,RateDetail:评价详情,OrderInvoice:发票信息。默认返回GuaranteesTerms、NativeLogistics、OrderInvoice。
+ $request_data['attributeKeys'] = $attributeKeys;//垂直表中的attributeKeys
+ $request_data['outOrderId'] = $outOrderId;//外部订单id,控制幂等
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * 获取交易订单的物流信息(买家视角)
+ *
+ * 该接口需要获得订单买家的授权,获取买家的订单的物流详情,在采购或者分销场景中,作为买家也有获取物流详情的需求。
+ * 该接口能查能根据订单号查看物流详情,包括发件人,收件人,所发货物明细等。由于物流单录入的原因,
+ * 可能跟踪信息的API查询会有延迟。该API需要向开放平台申请权限才能访问。
+ *
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.logistics:alibaba.trade.getLogisticsInfos.buyerView-1&aopApiCategory=Logistics_NEW
+ */
+ function getLogisticsInfosBuyerView(int $orderId,$webSite='1688',$fields=''){
+ $urlPath = "param2/1/com.alibaba.logistics/alibaba.trade.getLogisticsInfos.buyerView/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderId'] = $orderId;//交易的订单id 1234345
+ $request_data['webSite'] = $webSite;//站点信息,指定调用的API是属于国际站是1688业务还是icbu业务 (1688或者alibaba)
+ $request_data['fields'] = $fields;//需要返回的字段,目前有:company.name,sender,receiver,sendgood。返回的字段要用英文逗号分隔开
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+ /**
+ * 获取交易订单的物流跟踪信息(买家视角)
+ *
+ * 该接口需要获取订单买家的授权,获取买家的订单的物流跟踪信息,在采购或者分销场景中,作为买家也有获取物流详情的需求。
+ * 该接口能查能根据物流单号查看物流单跟踪信息。由于物流单录入的原因,可能跟踪信息的API查询会有延迟。
+ * 该API需要向开放平台申请权限才能访问。
+ *
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.logistics:alibaba.trade.getLogisticsTraceInfo.buyerView-1&aopApiCategory=Logistics_NEW
+ */
+ function getLogisticsTraceInfoBuyerView(int $orderId,$webSite='1688',$logisticsId=''){
+ $urlPath = "param2/1/com.alibaba.logistics/alibaba.trade.getLogisticsTraceInfo.buyerView/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderId'] = $orderId;//交易的订单id 1234345
+ $request_data['webSite'] = $webSite;//站点信息,指定调用的API是属于国际站是1688业务还是ic
+ $request_data['logisticsId'] = $logisticsId;//该订单下的物流编号 AL8234243
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * 买家确认收货
+ *
+ * doc:https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:trade.receivegoods.confirm-1
+ */
+ function receiveGoodsConfirm(int $orderId,$orderEntryIds=[]){
+ $urlPath = "param2/1/com.alibaba.trade/trade.receivegoods.confirm/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderId'] = $orderId;//交易的订单id 1234345
+ if($orderEntryIds){
+ $request_data['orderEntryIds'] = json_encode($orderEntryIds,JSON_UNESCAPED_UNICODE);
+ }
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php
new file mode 100644
index 0000000..69f6742
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictPay.php
@@ -0,0 +1,63 @@
+authObj->config['appkey'];
+ $request_data = [];
+
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+
+ /**
+ * desc:查询订单可以支持的支付渠道
+ * author:wh
+ * @param string $order_id
+ */
+ function queryOrderPayChannel(string $order_id){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.payWay.query/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderId'] = $order_id;
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * desc:组合收银台url获取
+ * author:wh
+ * @param string $orderIds 订单列表 格式参考 字符串格式的数组:["123456789","123456789"]
+ * @param string $payPlatformType PC或WIRELESS
+ * @return mixed
+ */
+ function getPayUrl(string $orderIds,string $payPlatformType){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.grouppay.url.get/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['orderIds'] = $orderIds;//json_encode($orderIds);
+ $request_data['payPlatformType'] = $payPlatformType;//PC或WIRELESS
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictRefund.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictRefund.php
new file mode 100644
index 0000000..05d847b
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alibaba/distributes/strict/StrictRefund.php
@@ -0,0 +1,257 @@
+authObj->config['appkey'];
+ $request_data = [];
+
+ //主订单
+ if(empty($params['orderId'])){
+ return Tools::set_fail('orderId不能为空');
+ }
+ $request_data['orderId'] = $params['orderId'];
+ //子订单 订单接口 productItems- subItemID 就是子订单ID,
+ // 卖家拒绝退款后无法重新申请,需要到1688后台退款单页面 修改退款协议
+ if(empty($params['orderEntryIds'])){
+ return Tools::set_fail('orderEntryIds不能为空');
+ }
+ $request_data['orderEntryIds'] = $params['orderEntryIds'];
+ //退款/退款退货。只有已收到货,才可以选择退款退货 退款:"refund"; 退款退货:"returnRefund"
+ if(empty($params['disputeRequest'])){
+ return Tools::set_fail('disputeRequest不能为空');
+ }
+ $request_data['disputeRequest'] = $params['disputeRequest'];
+ //退款金额(单位:分)。不大于实际付款金额;等待卖家发货时,必须为商品的实际付款金额。
+ if(empty($params['applyPayment'])){
+ return Tools::set_fail('applyPayment不能为空');
+ }
+ $request_data['applyPayment'] = $params['applyPayment'];
+ //退运费金额(单位:分)。
+ if(!isset($params['applyCarriage'])){
+ return Tools::set_fail('applyCarriage不能为空');
+ }
+ $request_data['applyCarriage'] = $params['applyCarriage'];
+ //退款原因id(从API getRefundReasonList获取)
+ if(empty($params['applyReasonId'])){
+ return Tools::set_fail('applyReasonId不能为空');
+ }
+ $request_data['applyReasonId'] = $params['applyReasonId'];
+ //退款申请理由,2-150字
+ if(empty($params['description'])){
+ return Tools::set_fail('description不能为空');
+ }
+ $request_data['description'] = $params['description'];
+ //货物状态 售中等待卖家发货:"refundWaitSellerSend"; 售中等待买家收货:"refundWaitBuyerReceive";
+ // 售中已收货(未确认完成交易):"refundBuyerReceived" 售后未收货:"aftersaleBuyerNotReceived";
+ // 售后已收到货:"aftersaleBuyerReceived"
+ if(empty($params['goodsStatus'])){
+ return Tools::set_fail('goodsStatus不能为空');
+ }
+ $request_data['goodsStatus'] = $params['goodsStatus'];
+ //凭证图片URLs。1-5张,必须使用API uploadRefundVoucher返回的“图片域名/相对路径”
+ if(isset($params['vouchers'])){
+ $request_data['vouchers'] = $params['vouchers'];
+ }
+ //子订单退款数量。仅在售中买家已收货(退款退货)时,可指定退货数量;默认,全部退货。[{"id":586683458996743215,"count":1}]
+ if(isset($params['orderEntryCountList'])){
+ $request_data['orderEntryCountList'] = $params['orderEntryCountList'];
+ }
+
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * 查询退款退货原因(用于创建退款退货)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.getRefundReasonList-1
+ */
+ function getRefundReasonList(int $orderId,array $orderEntryIds,$goodsStatus){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.getRefundReasonList/".$this->authObj->config['appkey'];
+
+ $request_data = [];
+ $request_data['orderId'] = $orderId;//主订单id 1234345
+ $request_data['orderEntryIds'] = json_encode($orderEntryIds);//子订单id Long[]
+ //售中等待买家发货:”refundWaitSellerSend"; 售中等待买家收货:"refundWaitBuyerReceive";
+ // 售中已收货(未确认完成交易):"refundBuyerReceived" 售后未收货:"aftersaleBuyerNotReceived";
+ // 售后已收到货:"aftersaleBuyerReceived"
+ $request_data['goodsStatus'] = $goodsStatus;//货物状态
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * @deprecated 【可在前端通过表单提交】
+ *
+ * 上传退款退货凭证
+ *
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.uploadRefundVoucher-1
+ */
+ function uploadRefundVoucher($imageData){
+ //$urlPath = "param2/1/com.alibaba.trade/alibaba.trade.uploadRefundVoucher/".$this->authObj->config['appkey'];
+ //$request_data = [];
+ //$request_data['imageData'] = $imageData;//凭证图片数据。小于1M,jpg格式。
+ //$res = $this->authObj->request($urlPath, $request_data);
+ //return $res;
+ }
+
+ /**
+ * 查询退款单列表(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.refund.buyer.queryOrderRefundList-1&aopApiCategory=trade_new
+ * 买家查看退款单列表,该接口不支持子账号查询,请使用主账号授权后查询
+ */
+ function queryOrderRefundList($params){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.refund.buyer.queryOrderRefundList/".$this->authObj->config['appkey'];
+ $request_data = [];
+ //订单Id
+ if(isset($params['orderId'])){
+ $request_data['orderId'] = $params['orderId'];
+ }
+ //退款申请时间(起始) 20220926114526000+0800
+ if(isset($params['applyStartTime'])){
+ $request_data['applyStartTime'] = $params['applyStartTime'];
+ }
+ //退款申请时间(截止) 20220926114526000+0800
+ if(isset($params['applyEndTime'])){
+ $request_data['applyEndTime'] = $params['applyEndTime'];
+ }
+ //退款状态列表 等待卖家同意 waitselleragree;退款成功 refundsuccess;退款关闭 refundclose;
+ //待买家修改 waitbuyermodify;等待买家退货 waitbuyersend;等待卖家确认收货 waitsellerreceive
+ if(isset($params['refundStatusSet'])){
+ $request_data['refundStatusSet'] = $params['refundStatusSet'];
+ }
+ //卖家memberId
+ if(isset($params['sellerMemberId'])){
+ $request_data['sellerMemberId'] = $params['sellerMemberId'];
+ }
+ //当前页码
+ if(isset($params['currentPageNum'])){
+ $request_data['currentPageNum'] = $params['currentPageNum'];
+ }
+ //每页条数
+ if(isset($params['pageSize'])){
+ $request_data['pageSize'] = $params['pageSize'];
+ }
+ //退货物流单号(传此字段查询时,需同时传入sellerMemberId)
+ if(isset($params['logisticsNo'])){
+ $request_data['logisticsNo'] = $params['logisticsNo'];
+ if(empty($params['sellerMemberId'])){
+ return Tools::set_fail('logisticsNo必须与sellerMemberId同时传入');
+ }
+ }
+ //退款修改时间(起始) 20220926114526000+0800
+ if(isset($params['modifyStartTime'])){
+ $request_data['modifyStartTime'] = $params['modifyStartTime'];
+ }
+ //退款修改时间(截止) 20220926114526000+0800
+ if(isset($params['modifyEndTime'])){
+ $request_data['modifyEndTime'] = $params['modifyEndTime'];
+ }
+ //1:售中退款,2:售后退款;0:所有退款单
+ if(isset($params['dipsuteType'])){
+ $request_data['dipsuteType'] = $params['dipsuteType'];
+ }
+
+
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * 查询退款单详情-根据订单ID(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.refund.OpQueryBatchRefundByOrderIdAndStatus-1&aopApiCategory=trade_new
+ */
+ function queryBatchRefundByOrderIdAndStatus(int $orderId,string $queryType){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.refund.OpQueryBatchRefundByOrderIdAndStatus/".$this->authObj->config['appkey'];
+ $request_data = [];
+ //订单Id
+ $request_data['orderId'] = $orderId;
+ //查询类型 1:活动;3:退款成功(只支持退款中和退款成功)
+ $request_data['queryType'] = $queryType;
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+ /**
+ * 退款单操作记录列表(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.refund.OpQueryOrderRefundOperationList-1
+ */
+ function queryOrderRefundOperationList(string $refundId,$pageNo=1,$pageSize=100){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.refund.OpQueryOrderRefundOperationList/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['refundId'] = $refundId;
+ $request_data['pageNo'] = $pageNo;
+ $request_data['pageSize'] = $pageSize;
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+ /**
+ * 查询退款单详情-根据退款单ID(买家视角)
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.refund.OpQueryOrderRefund-1&aopApiCategory=trade_new
+ */
+ function opQueryOrderRefund(string $refundId,$needTimeOutInfo=false,$needOrderRefundOperation=false){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.refund.OpQueryOrderRefund/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['refundId'] = $refundId;
+ if(isset($needTimeOutInfo)){
+ $request_data['needTimeOutInfo'] = $needTimeOutInfo;
+ }
+ if(isset($needOrderRefundOperation)){
+ $request_data['needOrderRefundOperation'] = $needOrderRefundOperation;
+ }
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+ /**
+ * 买家提交退款货信息
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.refund.returnGoods-1
+ */
+ function buyerSubmitRefundGoodsInfo(string $refundId,string $logisticsCompanyNo,string $freightBill,string $description='',string $vouchers=''){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.refund.returnGoods/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['refundId'] = $refundId;
+ $request_data['logisticsCompanyNo'] = $logisticsCompanyNo;
+ $request_data['freightBill'] = $freightBill;
+ if($description){
+ $request_data['description'] = $description;//发货说明,内容在2-200个字之间
+ }
+ //凭证图片URLs,必须使用API alibaba.trade.uploadRefundVoucher返回的“图片域名/相对路径”,
+ //最多可上传 10 张图片 ;单张大小不超过1M;支持jpg、gif、jpeg、png、和bmp格式。
+ // 请上传凭证,以便以后续赔所需(不上传将无法理赔)
+ if($vouchers){
+ $request_data['vouchers'] = $vouchers;//[https://cbu01.alicdn.com/img/ibank/2019/901/930/11848039109.jpg]
+ }
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+
+
+ /**
+ * 取消退款退货申请
+ * https://open.1688.com/api/apidocdetail.htm?id=com.alibaba.trade:alibaba.trade.cancelRefund-1
+ */
+ function cancelRefund(string $refundId){
+ $urlPath = "param2/1/com.alibaba.trade/alibaba.trade.cancelRefund/".$this->authObj->config['appkey'];
+ $request_data = [];
+ $request_data['refundId'] = $refundId;
+ $res = $this->authObj->request($urlPath, $request_data);
+ return $res;
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayAuthSDK.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayAuthSDK.php
new file mode 100644
index 0000000..8dd8de2
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayAuthSDK.php
@@ -0,0 +1,145 @@
+authExchangeOpenid($auth_code,$grantType);
+ return $alipay_system_oauth_token_response;
+ }else{
+ return session('session_alipay_system_oauth_token_response');
+ }
+ }else{
+ //实时获取
+ $alipay_system_oauth_token_response = $this->authExchangeOpenid($auth_code);
+ return $alipay_system_oauth_token_response;
+ }
+ }
+ // 第一步:构建授权URL (引导用户跳转)
+ function buildAuthUrl($auth_url)
+ {
+ //Tools::log_to_write_txt(['构建授权URL (引导用户跳转),$url'=>$auth_url]);
+ $redirect_uri = urlencode($auth_url); // 回调地址需在支付宝后台配置
+ $auth_url = "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?" .
+ "app_id={$this->alipayConfig['app_id']}&" .
+ "scope=auth_user&" .
+ "redirect_uri={$redirect_uri}&" .
+ "state=meebo";//自定义防CSRF参数
+ //Tools::log_to_write_txt(['构建授权URL (引导用户跳转),$auth_url:'=>$auth_url]);
+ return $auth_url;
+ }
+
+ // 第二步:获取授权码
+ function authExchangeOpenid($auth_code,$grantType='authorization_code'){
+ $root_path = Tools::get_root_path();
+ require_once($root_path.'library/alipay-sdk-php-all/aop/AopCertClient.php'); // 支付宝官方SDK, 需从开放平台下载
+ //AlipaySystemOauthTokenRequest
+ require_once($root_path.'library/alipay-sdk-php-all/aop/request/AlipaySystemOauthTokenRequest.php');
+
+ /** 初始化 **/
+ $aop = new \AopCertClient;
+
+ /** 支付宝网关 **/
+ $aop->gatewayUrl = "https://openapi.alipay.com/gateway.do";
+
+ /** 应用id,如何获取请参考:https://opensupport.alipay.com/support/helpcenter/190/201602493024 **/
+ $aop->appId = $this->alipayConfig['app_id'];
+
+ /** 密钥格式为pkcs1,如何获取私钥请参考:https://opensupport.alipay.com/support/helpcenter/207/201602469554 **/
+ $aop->rsaPrivateKey = $this->alipayConfig['alipay_app_private_key'];
+
+ /** 应用公钥证书路径,下载后保存位置的绝对路径 **/
+ $appCertPath = $root_path.$this->alipayConfig['appCertPublicKey'];
+
+ /** 支付宝公钥证书路径,下载后保存位置的绝对路径 **/
+ $alipayCertPath = $root_path.$this->alipayConfig['cert_path_alipayCertPublicKey_RSA2'];
+
+ /** 支付宝公钥证书路径,下载后保存位置的绝对路径 **/
+ $rootCertPath = $root_path.$this->alipayConfig['cert_path_alipayRootCert'];
+
+ /** 设置签名类型 **/
+ $aop->signType= "RSA2";
+
+ /** 设置请求格式,固定值json **/
+ $aop->format = "json";
+
+ /** 设置编码格式 **/
+ $aop->charset= "utf-8";
+
+ /** 调用getPublicKey从支付宝公钥证书中提取公钥 **/
+ $aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath);
+
+ /** 是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内 **/
+ $aop->isCheckAlipayPublicCert = true;
+
+ /** 调用getCertSN获取证书序列号 **/
+ $aop->appCertSN = $aop->getCertSN($appCertPath);
+
+ /** 调用getRootCertSN获取支付宝根证书序列号 **/
+ $aop->alipayRootCertSN = $aop->getRootCertSN($rootCertPath);
+
+ /** 实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称alipay.system.oauth.token(换取授权访问令牌) **/
+ $request = new \AlipaySystemOauthTokenRequest ();
+
+ /** 值为authorization_code时,代表用code换取;值为refresh_token时,代表用refresh_token换取 **/
+ $request->setGrantType($grantType);
+
+ /** 授权码,用户对应用授权后得到,可参考文档:https://opendocs.alipay.com/open/284/web **/
+ $request->setCode($auth_code);//"4b203fe6c11548bcabd8da5bb087a83b"
+
+ /** 刷新令牌,上次换取访问令牌时得到。见出参的refresh_token字段 **/
+ //$request->setRefreshToken("201208134b203fe6c11548bcabd8da5bb087a83b");
+
+
+ $result = $aop->execute ($request);
+
+ /**第三方调用(服务商模式),传值app_auth_token后,会收款至授权token对应商家账号,如何获传值app_auth_token请参考文档:https://opensupport.alipay.com/support/helpcenter/79/201602494631 **/
+ //$result = $aop->execute ($request,null,$app_auth_token);
+
+ $json = json_encode($result,JSON_UNESCAPED_UNICODE);
+ //dump($json);;
+ //array(3) {
+ // ["alipay_system_oauth_token_response"] => array(6) {
+ // ["access_token"] => string(40) "authusrB61082f01b2064753b039210cec7ddB44"
+ // ["auth_start"] => string(19) "2025-03-14 14:59:02"
+ // ["expires_in"] => int(1296000)
+ // ["re_expires_in"] => int(2592000)
+ // ["refresh_token"] => string(40) "authusrB85949807a38d4bffbd5c86ae7e797B44"
+ // ["open_id"] => string(47) "0442qO88pZKcduCIdYq7Z4N8y29dGoocWheNow1jt_QW1k4"
+ // }
+ // ["alipay_cert_sn"] => string(32) "9cbb86296783f52af85119eb59308f9a"
+ // ["sign"] => string(344) "qTFAlIaq3DO3L+9cjoXVJVhSipib8v2ot0Vb1cFEDdtVUH99eZsd33vDBDaKobf00XhVUBqx9WbL67GfEbUF94s6cPfGn9kHuYSMDKh5VRCUFF9TI+melq6GAXih9FbsgqUTY/OuAxz5GDfYL974CppSi7+uBodl0KCmt9kC6VgoC0tUe0s8MDC7LRWBEXheAwrfzMn8NzCpbJRSWRfmewRnBzNXC3SVV6KrMlQPaNcj4Wjl9JQxxCOFXRGqeCMF7pDLYPrChFy7TOCVE/ONUbBQcR1p3qqek3MO/QhpeumTB33VsfKTMQOKjWhEEfSYJa7vGxkQBnZ5QVVngzGVHg=="
+ //}
+ $json_arr = json_decode($json,true);
+ $alipay_system_oauth_token_response = $json_arr['alipay_system_oauth_token_response'];
+ session('session_alipay_system_oauth_token_response',$alipay_system_oauth_token_response);
+ //$open_id = $alipay_system_oauth_token_response['open_id'];
+ return $alipay_system_oauth_token_response;
+ }
+
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayLogic.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayLogic.php
new file mode 100644
index 0000000..4669e48
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/AlipayLogic.php
@@ -0,0 +1,82 @@
+setBody($order['goods_name']);
+ //$payRequestBuilder->setSubject($order['goods_name']);
+ //$payRequestBuilder->setOutTradeNo($out_trade_no);
+ //$payRequestBuilder->setTotalAmount($order['goods_price']);
+ //$payRequestBuilder->setTimeExpress($timeout_express);
+ //
+ //$payResponse = new \AlipayTradeService($config);
+
+
+ //$result = $payResponse->wapPay($payRequestBuilder,$return_url,$notify_url);
+ //return $result;
+ //}
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/BaseAlipay.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/BaseAlipay.php
new file mode 100644
index 0000000..049547a
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/BaseAlipay.php
@@ -0,0 +1,172 @@
+alipayConfig = $alipayConfig;
+ }
+
+ /**
+ * 查询支付宝账户余额
+ */
+ function queryBalance(){
+ //$transferConfig = new TransferConfig();
+ //$transferConfig->cert_path_alipayCertPublicKey_RSA2 = Tools::get_root_path().$alipayConfig['cert_path_alipayCertPublicKey_RSA2'];//'<-- 请填写您的支付宝公钥证书文件路径,例如:/foo/alipayCertPublicKey_RSA2.crt -->';
+ //$transferConfig->cert_path_alipayRootCert = Tools::get_root_path().$alipayConfig['cert_path_alipayRootCert'];//'<-- 请填写您的支付宝根证书文件路径,例如:/foo/alipayRootCert.crt" -->';
+ //$transferConfig->appCertPublicKey = Tools::get_root_path().$alipayConfig['appCertPublicKey'];//'<-- 请填写您的应用公钥证书文件路径,例如:/foo/appCertPublicKey_2019051064521003.crt -->'
+
+ //$trans_obj = new AlipayTransfer();
+ Factory::setOptions($this->getAlipayOptions());
+
+ $method = 'alipay.fund.account.query';
+ //公共参数
+ $textParams = [
+ 'app_id'=>$this->alipayConfig['app_id'],
+ 'charset'=>'utf-8',
+ 'sign_type'=>'RSA2',
+ 'timestamp'=>Tools::get_now_date(),
+ 'version'=>'1.0',
+ ];
+
+ //请求参数
+ //订单号前缀
+ $biz_content = [
+ 'account_type'=>'ACCTRANS_ACCOUNT',
+ ];
+ $pay_res = Factory::util()->generic()->execute($method,$textParams,$biz_content);
+
+ return $pay_res;
+ }
+
+ /**
+ * desc:证书模式参数(非证书模式参数需单独获取)
+ * author:wh
+ * @param array $this->alipayConfig 支付宝转账配置(非支付配置)
+ * @return Config
+ */
+ function getAlipayOptions($notifyUrl='')
+ {
+ $root_path = Tools::get_root_path();
+ $options = new Config();
+ $options->protocol = 'https';
+ $options->gatewayHost = 'openapi.alipay.com';
+ $options->signType = 'RSA2';
+
+ //'<-- 请填写您的AppId,例如:2019022663440152 -->'
+ $options->appId = $this->alipayConfig['app_id'];//'2021002103639985';
+
+ // 为避免私钥随源码泄露,推荐从文件中读取私钥字符串而不是写入源码中
+ $options->merchantPrivateKey = $this->alipayConfig['alipay_app_private_key'];//'<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->';
+
+ $options->alipayCertPath = $root_path.$this->alipayConfig['cert_path_alipayCertPublicKey_RSA2'];//'<-- 请填写您的支付宝公钥证书文件路径,例如:/foo/alipayCertPublicKey_RSA2.crt -->';
+ $options->alipayRootCertPath = $root_path.$this->alipayConfig['cert_path_alipayRootCert'];//'<-- 请填写您的支付宝根证书文件路径,例如:/foo/alipayRootCert.crt" -->';
+ $options->merchantCertPath = $root_path.$this->alipayConfig['appCertPublicKey'];//'<-- 请填写您的应用公钥证书文件路径,例如:/foo/appCertPublicKey_2019051064521003.crt -->';
+
+ //注:如果采用非证书模式,则无需赋值上面的三个证书路径,改为赋值如下的支付宝公钥字符串即可
+ // $options->alipayPublicKey = $this->alipayConfig['alipay_public_key'];//'<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->';
+
+ //可设置异步通知接收服务地址(可选)
+ $options->notifyUrl = $notifyUrl;//"<-- 请填写您的支付类接口异步通知接收服务地址,例如:https://www.test.com/callback -->";
+
+ //可设置AES密钥,调用AES加解密相关接口时需要(可选)
+ //$options->encryptKey = "<-- 请填写您的AES密钥,例如:aa4BtZ4tspm2wnXLb1ThQA== -->";
+
+ return $options;
+ }
+
+ /**
+ * 支付宝退款
+ *
+ * 注意:需要在正式服测,本地会报错
+ *
+ * doc:
+ * https://opendocs.alipay.com/open/3aea9b48_alipay.trade.refund?pathHash=4de421df&scene=common
+ *
+ * 测试结果:
+ * object(Alipay\EasySDK\Util\Generic\Models\AlipayOpenApiGenericResponse)#93 (7) {
+ ["_name":protected] => array(5) {
+ ["httpBody"] => string(9) "http_body"
+ ["code"] => string(4) "code"
+ ["msg"] => string(3) "msg"
+ ["subCode"] => string(8) "sub_code"
+ ["subMsg"] => string(7) "sub_msg"
+ }
+ ["httpBody"] => string(826) "{"alipay_trade_refund_response":{"code":"10000","msg":"Success","buyer_logon_id":"150******25","fund_change":"Y","gmt_refund_pay":"2025-02-24 10:06:26","out_trade_no":"h5cqa31h1740360008389","refund_detail_item_list":[{"amount":"0.11","fund_channel":"ALIPAYACCOUNT"}],"refund_fee":"0.11","send_back_fee":"0.11","trade_no":"2025022422001457441416271979","buyer_open_id":"0442qO88pZKcduCIdYq7Z4N8y29dGoocWheNow1jt_QW1k4"},"alipay_cert_sn":"9cbb86296783f52af85119eb59308f9a","sign":"fcmu9CwYw0uziZTNImfGJvaYE9EdO4OoeKjktl/jxn+EGKvybDijKxTsn+jRM99jm9gcvmQmqweTd6OJMkep6cut1Tl5jsktYGy+ri1lLTGc9eNg+ctyO6qylnVaKQstV0QNZkuRo6Y36W3ZXolZk81ppNM1chtupsALHfwoWSirupqJ6Y52iBRG67kN0AxexL8mbOhwGS9vAMbMXoyRKJ7ajLGSmpnhb1sMvHVhFkvXaCBrzn6Nt1TMw6cyelqNHsAsmJ+OSnndVcRaqt9Q+IAwn98vhBhl1J5Vi7cWbsIYeki+TViQZ2ArW09IdBrP+A9qIydeM0BQdElRFWntvg=="}"
+ ["code"] => string(5) "10000"
+ ["msg"] => string(7) "Success"
+ ["subCode"] => NULL
+ ["subMsg"] => NULL
+ ["_required":protected] => array(0) {
+ }
+ }
+ */
+ function aliRefund($order_info){
+ $alipayConfig = $this->alipayConfig;
+ //$transferConfig = new TransferConfig();
+ //$transferConfig->cert_path_alipayCertPublicKey_RSA2 = Tools::get_root_path().$alipayConfig['cert_path_alipayCertPublicKey_RSA2'];//'<-- 请填写您的支付宝公钥证书文件路径,例如:/foo/alipayCertPublicKey_RSA2.crt -->';
+ //$transferConfig->cert_path_alipayRootCert = Tools::get_root_path().$alipayConfig['cert_path_alipayRootCert'];//'<-- 请填写您的支付宝根证书文件路径,例如:/foo/alipayRootCert.crt" -->';
+ //$transferConfig->appCertPublicKey = Tools::get_root_path().$alipayConfig['appCertPublicKey'];//'<-- 请填写您的应用公钥证书文件路径,例如:/foo/appCertPublicKey_2019051064521003.crt -->'
+
+
+ Factory::setOptions($this->getAlipayOptions());
+
+ $method = 'alipay.trade.refund';
+ //公共参数
+ $textParams = [
+ 'app_id'=>$alipayConfig['app_id'],
+ 'charset'=>'utf-8',
+ 'sign_type'=>'RSA2',
+ 'timestamp'=>Tools::get_now_date(),
+ 'version'=>'1.0',
+ ];
+
+ //请求参数 wap/pc/app支付
+
+ //【描述】退分账明细信息。
+ // 注: 1.当面付且非直付通模式无需传入退分账明细,系统自动按退款金额与订单金额的比率,
+ //从收款方和分账收入方退款,不支持指定退款金额与退款方。
+ // 2.直付通模式,电脑网站支付,手机 APP 支付,手机网站支付产品,须在退款请求中明确是否退分账,
+ //从哪个分账收入方退,退多少分账金额;
+ //如不明确,默认从收款方退款,收款方余额不足退款失败。不支持系统按比率退款。
+ $refund_royalty_parameters = [];//如果有分账,此项必填
+ //订单号前缀
+ $biz_content = [
+ //'account_type'=>'ACCTRANS_ACCOUNT',
+ 'out_trade_no'=>$order_info['orderid'],
+ 'refund_amount'=>$order_info['real_amount'],
+ ];
+ if($refund_royalty_parameters){
+ $biz_content['refund_royalty_parameters'] = $refund_royalty_parameters;
+ }
+ $pay_res = Factory::util()->generic()->execute($method,$textParams,$biz_content);
+
+ return $pay_res;
+
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/alipay-sdk-php-all.zip b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/alipay-sdk-php-all.zip
new file mode 100644
index 0000000..211bdcb
Binary files /dev/null and b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/alipay-sdk-php-all.zip differ
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayAppPay.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayAppPay.php
new file mode 100644
index 0000000..e39bfc5
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayAppPay.php
@@ -0,0 +1,140 @@
+getAlipayConfig($this->pay_config));
+ // 构造请求参数以调用接口
+ $request = new \AlipayTradeAppPayRequest();
+ $model = array();
+ // 设置商户订单号
+ $model['out_trade_no'] = $order['orderid'];
+
+ // 设置订单总金额
+ $model['total_amount'] = $order['real_amount'];//实付金额
+
+ // 设置订单标题
+ $model['subject'] = $order['remark'];
+
+ //// 设置产品码
+ //$model['product_code'] = "QUICK_MSECURITY_PAY";
+ //
+ ////设置订单包含的商品列表信息
+ //$goodsDetail = array();
+ //$goodsDetail0 = array();
+ //$goodsDetail0['goods_name'] = "ipad";
+ //$goodsDetail0['alipay_goods_id'] = "20010001";
+ //$goodsDetail0['quantity'] = 1;
+ //$goodsDetail0['price'] = "2000";
+ //$goodsDetail0['goods_id'] = "apple-01";
+ //$goodsDetail0['goods_category'] = "34543238";
+ //$goodsDetail0['categories_tree'] = "124868003|126232002|126252004";
+ //$goodsDetail0['show_url'] = "http://www.alipay.com/xxx.jpg";
+ //$goodsDetail[] = $goodsDetail0;
+ //$model['goods_detail'] = $goodsDetail;
+ //
+ ////设置订单绝对超时时间
+ //$model['time_expire'] = "2016-12-31 10:05:00";
+ //
+ ////设置业务扩展参数
+ //$extendParams = array();
+ //$extendParams['sys_service_provider_id'] = "2088511833207846";
+ //$extendParams['hb_fq_seller_percent'] = "100";
+ //$extendParams['hb_fq_num'] = "3";
+ //$extendParams['industry_reflux_info'] = "{\"scene_code\":\"metro_tradeorder\",\"channel\":\"xxxx\",\"scene_data\":{\"asset_name\":\"ALIPAY\"}}";
+ //$extendParams['specified_seller_name'] = "XXX的跨境小铺";
+ //$extendParams['royalty_freeze'] = "true";
+ //$extendParams['card_type'] = "S0JP0000";
+ //$model['extend_params'] = $extendParams;
+ //
+ ////设置公用回传参数
+ //$model['passback_params'] = "merchantBizType%3d3C%26merchantBizNo%3d2016010101111";
+ //
+ ////设置商户的原始订单号
+ //$model['merchant_order_no'] = "20161008001";
+ //
+ ////设置外部指定买家
+ //$extUserInfo = array();
+ //$extUserInfo['cert_type'] = "IDENTITY_CARD";
+ //$extUserInfo['cert_no'] = "362334768769238881";
+ //$extUserInfo['name'] = "李明";
+ //$extUserInfo['mobile'] = "16587658765";
+ //$extUserInfo['min_age'] = "18";
+ //$extUserInfo['need_check_info'] = "F";
+ //$extUserInfo['identity_hash'] = "27bfcd1dee4f22c8fe8a2374af9b660419d1361b1c207e9b41a754a113f38fcc";
+ //$model['ext_user_info'] = $extUserInfo;
+ //
+ ////设置通知参数选项
+ //$queryOptions = array();
+ //$queryOptions[] = "hyb_amount";
+ //$queryOptions[] = "enterprise_pay_info";
+ //$model['query_options'] = $queryOptions;
+
+ //dump($pay_config);
+ $request->setBizContent(json_encode($model, JSON_UNESCAPED_UNICODE));
+ $request->setNotifyUrl($this->notifyUrl);
+ // 如果是第三方代调用模式,请设置app_auth_token(应用授权令牌)
+ $authToken = $this->pay_config['app_auth_token'];//"<-- 请填写应用授权令牌 -->"
+ $orderStr = $alipayClient->sdkExecute($request, $authToken);
+
+ return Tools::set_ok('ok',$orderStr);
+ }
+
+ private function getAlipayConfig($pay_config)
+ {
+ $privateKey = $pay_config['alipay_app_private_key'];//'<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->';
+ $alipayPublicKey = $pay_config['alipay_app_public_key'];//'<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->';
+ $alipayConfig = new \AlipayConfig();
+ $alipayConfig->setServerUrl('https://openapi.alipay.com/gateway.do');
+ $alipayConfig->setAppId($pay_config['app_id']);//'<-- 请填写您的AppId,例如:2019091767145019 -->'
+ $alipayConfig->setPrivateKey($privateKey);
+ $alipayConfig->setFormat('json');
+ $alipayConfig->setAlipayPublicKey($alipayPublicKey);
+ $alipayConfig->setCharset('UTF-8');
+ $alipayConfig->setSignType('RSA2');
+ return $alipayConfig;
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayScanPay.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayScanPay.php
new file mode 100644
index 0000000..5a72962
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayScanPay.php
@@ -0,0 +1,184 @@
+getOptions());
+ //2. 发起API调用(以支付能力下的统一收单交易创建接口为例)
+ $result = Factory::payment()->faceToFace()
+ ->optional('scene','bar_code')
+ ->pay($order['title'], $order['orderid'], $order['real_amount'], $auth_code);
+
+ if($result->code == 10003){
+ return Tools::set_res(230,'交易进行中(提示用户输入密码)'.$result->msg);
+ }
+ //必须解析json
+ $resp = json_decode($result->httpBody, true);
+ //支付宝面对面扫码支付后续流程
+ return Tools::set_ok('ok',$resp['alipay_trade_pay_response']);//返回支付结果(一维数组)
+ } catch (\Exception $e) {
+ $err_data = [
+ 'error'=>'支付宝付款码支付错误'.$e->getMessage(),
+ 'error_info'=>$e->getTraceAsString()
+ ];
+ Tools::log_to_write_txt($err_data);
+ return Tools::set_fail('错误.'.$e->getMessage());
+ }
+ }
+
+
+ /**
+ * desc:获取支付配置
+ * author:wh
+ * @throws Exception
+ */
+ private function getOptions()
+ {
+ if(empty($this->pay_config)){
+ throw new Exception('支付宝配置错误');
+ }
+ if(empty($this->pay_config['notifyUrl'])){
+ throw new Exception('支付宝配置错误:notifyUrl通知地址字段必须配置(免密支付是同步返回支付结果,输入密码支付是异步通知支付结果)');
+ }
+ $options = new Config();
+ $options->protocol = 'https';
+ $options->gatewayHost = 'openapi.alipay.com';
+ $options->signType = $this->pay_config['sign_type'];
+
+ $options->appId = $this->pay_config['app_id'];//'<-- 请填写您的AppId,例如:2019022663440152 -->';
+
+ // 为避免私钥随源码泄露,推荐从文件中读取私钥字符串而不是写入源码中
+ $options->merchantPrivateKey = $this->pay_config['alipay_app_private_key'];//'<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->';
+
+ $options->alipayCertPath = Tools::get_root_path().$this->pay_config['cert_path_alipayCertPublicKey_RSA2'];//'<-- 请填写您的支付宝公钥证书文件路径,例如:/foo/alipayCertPublicKey_RSA2.crt -->';
+ $options->alipayRootCertPath = Tools::get_root_path().$this->pay_config['cert_path_alipayRootCert'];//'<-- 请填写您的支付宝根证书文件路径,例如:/foo/alipayRootCert.crt" -->';
+ $options->merchantCertPath = Tools::get_root_path().$this->pay_config['appCertPublicKey'];//'<-- 请填写您的应用公钥证书文件路径,例如:/foo/appCertPublicKey_2019051064521003.crt -->';
+
+ //注:如果采用非证书模式,则无需赋值上面的三个证书路径,改为赋值如下的支付宝公钥字符串即可
+ // $options->alipayPublicKey = '<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->';
+
+ //可设置异步通知接收服务地址(可选)
+ $options->notifyUrl = $this->pay_config['notifyUrl'];//request()->domain().'/index/alipay/notify';//"<-- 请填写您的支付类接口异步通知接收服务地址,例如:https://www.test.com/callback -->";
+
+ return $options;
+ }
+
+
+ /**
+ * desc:支付宝扫码异步通知
+ *
+ * 【通知结果是一维数组】
+ *
+ * {"gmt_create":"2024-06-10 11:53:37","charset":"UTF-8","seller_email":"15023017325",
+ * "subject":"购物消费",
+ * "sign":"oCR3X0ViRrydigLMeOCTrMBNx7O8bSZnEflT0qZYo0gXk2jTI2OVB9mG2UPCkGuSND3wq/pMRFN
+ * ljuz+2r3KMha9a6ArD/ey8w1am3yCKI+FMqUMQSv9TJqfpWdAsc8B45egtr+txBBOA1NMfN41hPnTxM3QzQ82cm
+ * 7VYw6pnYpxJVj/3AsqYxY+wcyMq5+v25eC4TgBo+YJ9pfb3rqaAV91cJBoHRq1Cwh0XEnOzm9zpv7b5cu3r+V0oeW
+ * wTCCi8S1TXW2dfE4H8o63xgASYfJO2fgGIu19YICQdUONkDhu9Tfbf3fFf9SHw3RIw8zrQRqkwAXC32NwfUv4Ru5NqQ==",
+ * "buyer_id":"2088612757425274","invoice_amount":"3258.60","notify_id":"2024061001222115350025271439748729",
+ * "fund_bill_list":"[{\"amount\":\"3258.60\",\"fundChannel\":\"ALIPAYACCOUNT\"}]",
+ * "notify_type":"trade_status_sync","trade_status":"TRADE_SUCCESS","receipt_amount":"3258.60",
+ * "app_id":"2021004136614333","buyer_pay_amount":"3258.60","sign_type":"RSA2",
+ * "seller_id":"2088642975857443","gmt_payment":"2024-06-10 11:53:50",
+ * "notify_time":"2024-06-10 12:07:40","version":"1.0","out_trade_no":"cs25obpv1717991615660",
+ * "total_amount":"3258.60","trade_no":"2024061022001425271426453509","auth_app_id":"2021004136614333",
+ * "buyer_logon_id":"146***@qq.com","point_amount":"0.00"}
+ *
+ * author:wh
+ * param function $fn 传入订单处理逻辑函数 要求返回success、fail
+ * @return string
+ */
+ function scanPayNotify($fn){
+ Tools::log_to_write_txt([
+ '支付宝异步通知',
+ 'input'=>input()
+ ]);
+
+ $out_trade_no = input('out_trade_no');
+ if(empty($out_trade_no)){
+ Tools::log_to_write_txt(['error'=>'out_trade_no为空,文件:'.__FILE__.',line:'.__LINE__]);
+ return '';
+ }
+ //$order = Db::table(TabConf::$fa_order)
+ // ->where('orderid',$out_trade_no)
+ // ->find();
+ //if(empty($order)){
+ // Tools::log_to_write_txt(['error'=>'订单不存在,文件:'.__FILE__.',line:'.__LINE__]);
+ // return '';
+ //}
+ //该字段用于判断成功、失败
+ $trade_status = input('trade_status');
+ if(empty($trade_status)){
+ Tools::log_to_write_txt(['error'=>'trade_status为空,文件:'.__FILE__.',line:'.__LINE__]);
+ return '';
+ }
+ if(empty($this->pay_config['seller_id'])){
+ Tools::log_to_write_txt(['error'=>'卖家seller_id为空,文件:'.__FILE__.',line:'.__LINE__]);
+ return '';
+ }
+
+ //判断来源
+ $seller_id = input('seller_id');
+ if($seller_id != $this->pay_config['seller_id']){
+ Tools::log_to_write_txt(['error'=>'支付通知来源错误','seller_id'=>$seller_id,'config'=>$this->pay_config['seller_id']]);
+ return 'fail';
+ }
+ //支付宝面对面扫码支付后续流程
+ $result = input();
+ //异步通知
+ //$res = CheckstandLogic::alipayScanSuccessFlow($result,$order);
+ //if($res['code'] == 200 || $res['code'] == 230){//成功或进行中
+ // return 'success';
+ //}
+ return $fn($result);//要求返回success、fail
+ }
+}
\ No newline at end of file
diff --git a/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayWapPay.php b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayWapPay.php
new file mode 100644
index 0000000..c8bbb74
--- /dev/null
+++ b/superadmin/vendor/wanghua/general-utility-tools-php/src/alipay/pay/AlipayWapPay.php
@@ -0,0 +1,271 @@
+alipayConfig;
+
+ /** 初始化 **/
+ $aop = new \AopCertClient();
+
+ /** 支付宝网关 **/
+ $aop->gatewayUrl = "https://openapi.alipay.com/gateway.do";
+
+ /** 应用id,如何获取请参考:https://opensupport.alipay.com/support/helpcenter/190/201602493024 **/
+ $aop->appId = $alipayConfig['app_id'];
+
+ /** 密钥格式为pkcs1,如何获取私钥请参考:https://opensupport.alipay.com/support/helpcenter/207/201602469554 **/
+ $aop->rsaPrivateKey = $alipayConfig['alipay_app_private_key'];
+
+ /** 应用公钥证书路径,下载后保存位置的绝对路径 **/
+ $appCertPath = $root_path.$alipayConfig['appCertPublicKey'];
+
+ /** 支付宝公钥证书路径,下载后保存位置的绝对路径 **/
+ $alipayCertPath = $root_path.$alipayConfig['cert_path_alipayCertPublicKey_RSA2'];
+
+ /** 支付宝公钥证书路径,下载后保存位置的绝对路径 **/
+ $rootCertPath = $root_path.$alipayConfig['cert_path_alipayRootCert'];
+
+ /** 设置签名类型 **/
+ $aop->signType= "RSA2";
+
+ /** 设置请求格式,固定值json **/
+ $aop->format = "json";
+
+ /** 设置编码格式 **/
+ $aop->charset= "utf-8";
+
+ /** 调用getPublicKey从支付宝公钥证书中提取公钥 **/
+ $aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath);
+
+ /** 是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内 **/
+ $aop->isCheckAlipayPublicCert = true;
+
+ /** 调用getCertSN获取证书序列号 **/
+ $aop->appCertSN = $aop->getCertSN($appCertPath);
+
+ /** 调用getRootCertSN获取支付宝根证书序列号 **/
+ $aop->alipayRootCertSN = $aop->getRootCertSN($rootCertPath);
+
+ /** 实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.wap.pay **/
+ $request = new \AlipayTradeWapPayRequest();
+
+ /** 设置业务参数 **/
+ $request->setBizContent("{" .
+
+ /** 商户订单号,商户自定义,需保证在商户端不重复,如:20150320010101001 **/
+ "'out_trade_no':'$orderid'," .
+
+ /** 销售产品码,固定值:QUICK_WAP_WAY **/
+ "'product_code':'QUICK_WAP_WAY'," .
+
+ /** 订单金额,精确到小数点后两位 **/
+ "'total_amount':'$total_amount'," .
+
+ /** 订单标题 **/
+ "'subject':'$subject'," .
+
+ /** 业务扩展参数 **/
+ // "'extend_params':{" .
+ /** 系统商编号,填写服务商的PID用于获取返佣,返佣参数传值前提:传值账号需要签约返佣协议,用于isv商户。 **/
+ //"'sys_service_provider_id':'2088511833207846'," .
+
+ /** 花呗分期参数传值前提:必须有该接口花呗收款准入条件,且需签约花呗分期 **/
+ /** 指定可选期数,只支持3/6/12期,还款期数越长手续费越高 **/
+ // "'hb_fq_num':'3'," .
+
+ /** 指定花呗分期手续费承担方式,手续费可以由用户全承担(该值为0),也可以商户全承担(该值为100),但不可以共同承担,即不可取0和100外的其他值。 **/
+ //"'hb_fq_seller_percent':'100'" .
+ // "}," .
+
+ /** 订单描述 **/
+ "'body':'$subject'" .
+ "}");
+
+ /**注:支付结果以异步通知为准,不能以同步返回为准,因为如果实际支付成功,但因为外力因素,如断网、断电等导致页面没有跳转,则无法接收到同步通知;**/
+ /** 支付完成的跳转地址,用于用户视觉感知支付已成功,传值外网可以访问的地址,如果同步未跳转可参考该文档进行确认:https://opensupport.alipay.com/support/helpcenter/193/201602474937 **/
+ $request->setReturnUrl($pay_end_url);
+
+ /** 异步通知地址,以http或者https开头的,商户外网可以post访问的异步地址,用于接收支付宝返回的支付结果,如果未收到该通知可参考该文档进行确认:https://opensupport.alipay.com/support/helpcenter/193/201602475759 **/
+ $request->setNotifyUrl($notify_url);
+
+ /** 调用SDK生成支付链接,可在浏览器打开链接进入支付页面 **/
+ $result = $aop->pageExecute ($request,'get');
+
+ /**第三方调用(服务商模式),传值app_auth_token后,会收款至授权token对应商家账号,如何获传值app_auth_token请参考文档:https://opensupport.alipay.com/support/helpcenter/79/201602494631 **/
+ //$result = $aop->pageExecute($request,'get',"传入获取到的app_auth_token值");
+
+ /** 获取接口调用结果,如果调用失败,可根据返回错误信息到该文档寻找排查方案:https://opensupport.alipay.com/support/helpcenter/93 **/
+ //print_r(htmlspecialchars($result));
+ $html = <<