mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-20 05:59:14 +08:00
ComposerUpdate
This commit is contained in:
parent
f9fe32e1ae
commit
2c83952878
@ -12,7 +12,6 @@
|
||||
"php": ">=5.6",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-soap": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-mbstring": "*",
|
||||
|
5
vendor/composer/autoload_classmap.php
vendored
5
vendor/composer/autoload_classmap.php
vendored
@ -10,6 +10,7 @@ return array(
|
||||
'AliPay\\Bill' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Bill.php',
|
||||
'AliPay\\Pos' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Pos.php',
|
||||
'AliPay\\Scan' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Scan.php',
|
||||
'AliPay\\Trade' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Trade.php',
|
||||
'AliPay\\Transfer' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Transfer.php',
|
||||
'AliPay\\Wap' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Wap.php',
|
||||
'AliPay\\Web' => $vendorDir . '/zoujingli/wechat-developer/AliPay/Web.php',
|
||||
@ -163,14 +164,18 @@ return array(
|
||||
'WeMini\\Crypt' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Crypt.php',
|
||||
'WeMini\\Delivery' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Delivery.php',
|
||||
'WeMini\\Domain' => $vendorDir . '/zoujingli/weopen-developer/WeMini/Domain.php',
|
||||
'WeMini\\Guide' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Guide.php',
|
||||
'WeMini\\Image' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Image.php',
|
||||
'WeMini\\Live' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Live.php',
|
||||
'WeMini\\Logistics' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Logistics.php',
|
||||
'WeMini\\Message' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Message.php',
|
||||
'WeMini\\Newtmpl' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Newtmpl.php',
|
||||
'WeMini\\Ocr' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Ocr.php',
|
||||
'WeMini\\Operation' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Operation.php',
|
||||
'WeMini\\Plugs' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Plugs.php',
|
||||
'WeMini\\Poi' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Poi.php',
|
||||
'WeMini\\Qrcode' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Qrcode.php',
|
||||
'WeMini\\Search' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Search.php',
|
||||
'WeMini\\Security' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Security.php',
|
||||
'WeMini\\Soter' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Soter.php',
|
||||
'WeMini\\Template' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Template.php',
|
||||
|
3
vendor/composer/autoload_real.php
vendored
3
vendor/composer/autoload_real.php
vendored
@ -13,6 +13,9 @@ class ComposerAutoloaderInitbf5dd43c242f2a86b1513b16fb281176
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
|
5
vendor/composer/autoload_static.php
vendored
5
vendor/composer/autoload_static.php
vendored
@ -111,6 +111,7 @@ class ComposerStaticInitbf5dd43c242f2a86b1513b16fb281176
|
||||
'AliPay\\Bill' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Bill.php',
|
||||
'AliPay\\Pos' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Pos.php',
|
||||
'AliPay\\Scan' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Scan.php',
|
||||
'AliPay\\Trade' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Trade.php',
|
||||
'AliPay\\Transfer' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Transfer.php',
|
||||
'AliPay\\Wap' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Wap.php',
|
||||
'AliPay\\Web' => __DIR__ . '/..' . '/zoujingli/wechat-developer/AliPay/Web.php',
|
||||
@ -264,14 +265,18 @@ class ComposerStaticInitbf5dd43c242f2a86b1513b16fb281176
|
||||
'WeMini\\Crypt' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Crypt.php',
|
||||
'WeMini\\Delivery' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Delivery.php',
|
||||
'WeMini\\Domain' => __DIR__ . '/..' . '/zoujingli/weopen-developer/WeMini/Domain.php',
|
||||
'WeMini\\Guide' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Guide.php',
|
||||
'WeMini\\Image' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Image.php',
|
||||
'WeMini\\Live' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Live.php',
|
||||
'WeMini\\Logistics' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Logistics.php',
|
||||
'WeMini\\Message' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Message.php',
|
||||
'WeMini\\Newtmpl' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Newtmpl.php',
|
||||
'WeMini\\Ocr' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Ocr.php',
|
||||
'WeMini\\Operation' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Operation.php',
|
||||
'WeMini\\Plugs' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Plugs.php',
|
||||
'WeMini\\Poi' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Poi.php',
|
||||
'WeMini\\Qrcode' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Qrcode.php',
|
||||
'WeMini\\Search' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Search.php',
|
||||
'WeMini\\Security' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Security.php',
|
||||
'WeMini\\Soter' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Soter.php',
|
||||
'WeMini\\Template' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Template.php',
|
||||
|
66
vendor/composer/installed.json
vendored
66
vendor/composer/installed.json
vendored
@ -177,17 +177,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v3.4.38",
|
||||
"version_normalized": "3.4.38.0",
|
||||
"version": "v3.4.42",
|
||||
"version_normalized": "3.4.42.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
"reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed"
|
||||
"reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/730ef56164ed6c9356c159e9f5ff2b84d753b9ed",
|
||||
"reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/3b9fe6db7fe3694307d182dd73983584af77d5fd",
|
||||
"reference": "3b9fe6db7fe3694307d182dd73983584af77d5fd",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -199,7 +199,7 @@
|
||||
"require": {
|
||||
"php": "^5.5.9|>=7.0.8"
|
||||
},
|
||||
"time": "2020-01-01T11:03:25+00:00",
|
||||
"time": "2020-05-21T13:02:25+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -235,6 +235,20 @@
|
||||
"config",
|
||||
"configuration",
|
||||
"options"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -298,17 +312,17 @@
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-helper",
|
||||
"version": "v3.1.3",
|
||||
"version_normalized": "3.1.3.0",
|
||||
"version": "v3.1.4",
|
||||
"version_normalized": "3.1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-helper.git",
|
||||
"reference": "4d85dfd3778623bbb1de3648f1dcd0c82f4439f4"
|
||||
"reference": "c28d37743bda4a0455286ca85b17b5791d626e10"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-helper/zipball/4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"reference": "4d85dfd3778623bbb1de3648f1dcd0c82f4439f4",
|
||||
"url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10",
|
||||
"reference": "c28d37743bda4a0455286ca85b17b5791d626e10",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -320,7 +334,7 @@
|
||||
"require": {
|
||||
"php": ">=7.1.0"
|
||||
},
|
||||
"time": "2019-09-30T02:36:48+00:00",
|
||||
"time": "2019-11-08T08:01:10+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -502,12 +516,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "997cf0eb09f433a42ab3fe7f61fb4448603557c2"
|
||||
"reference": "15355674ad8878421dde91c15bb975fc4c47981a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/997cf0eb09f433a42ab3fe7f61fb4448603557c2",
|
||||
"reference": "997cf0eb09f433a42ab3fe7f61fb4448603557c2",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/15355674ad8878421dde91c15bb975fc4c47981a",
|
||||
"reference": "15355674ad8878421dde91c15bb975fc4c47981a",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -523,11 +537,11 @@
|
||||
"ext-iconv": "*",
|
||||
"ext-json": "*",
|
||||
"ext-openssl": "*",
|
||||
"php": ">=5.4",
|
||||
"php": ">=5.5",
|
||||
"qiniu/php-sdk": "^7.2",
|
||||
"topthink/framework": "5.1.*"
|
||||
},
|
||||
"time": "2020-03-03T03:03:27+00:00",
|
||||
"time": "2020-05-22T02:55:01+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -547,17 +561,17 @@
|
||||
},
|
||||
{
|
||||
"name": "zoujingli/wechat-developer",
|
||||
"version": "v1.2.17",
|
||||
"version_normalized": "1.2.17.0",
|
||||
"version": "v1.2.21",
|
||||
"version_normalized": "1.2.21.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/WeChatDeveloper.git",
|
||||
"reference": "98f6e82311a364220a677cdfd56dc9f97851ab24"
|
||||
"reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/98f6e82311a364220a677cdfd56dc9f97851ab24",
|
||||
"reference": "98f6e82311a364220a677cdfd56dc9f97851ab24",
|
||||
"url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/5cf008c37471f775ae28a23fd1ac06c91eac682f",
|
||||
"reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -567,15 +581,17 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"ext-bcmath": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-xml": "*",
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"time": "2020-03-03T01:38:07+00:00",
|
||||
"time": "2020-04-26T03:22:09+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -584,8 +600,8 @@
|
||||
],
|
||||
"psr-4": {
|
||||
"WePay\\": "WePay",
|
||||
"WeMini\\": "WeMini",
|
||||
"WeChat\\": "WeChat",
|
||||
"WeMini\\": "WeMini",
|
||||
"AliPay\\": "AliPay"
|
||||
}
|
||||
},
|
||||
@ -597,7 +613,7 @@
|
||||
{
|
||||
"name": "Anyon",
|
||||
"email": "zoujingli@qq.com",
|
||||
"homepage": "http://ctolog.com"
|
||||
"homepage": "https://thinkadmin.top"
|
||||
}
|
||||
],
|
||||
"description": "WeChat platform and WeChat payment development tools",
|
||||
|
@ -146,7 +146,7 @@ class OptionsResolver implements Options
|
||||
$reflClosure = new \ReflectionFunction($value);
|
||||
$params = $reflClosure->getParameters();
|
||||
|
||||
if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && Options::class === $class->name) {
|
||||
if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) {
|
||||
// Initialize the option if no previous value exists
|
||||
if (!isset($this->defaults[$option])) {
|
||||
$this->defaults[$option] = null;
|
||||
@ -1066,4 +1066,20 @@ class OptionsResolver implements Options
|
||||
{
|
||||
return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
private function getParameterClassName(\ReflectionParameter $parameter)
|
||||
{
|
||||
if (!method_exists($parameter, 'getType')) {
|
||||
return ($class = $parameter->getClass()) ? $class->name : null;
|
||||
}
|
||||
|
||||
if (!($type = $parameter->getType()) || $type->isBuiltin()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return method_exists($type, 'getName') ? $type->getName() : (string) $type;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class OptionsResolverIntrospectorTest extends TestCase
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getDefault($option));
|
||||
$debug->getDefault($option);
|
||||
}
|
||||
|
||||
public function testGetDefaultThrowsOnNotDefinedOption()
|
||||
@ -54,7 +54,7 @@ class OptionsResolverIntrospectorTest extends TestCase
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getDefault('foo'));
|
||||
$debug->getDefault('foo');
|
||||
}
|
||||
|
||||
public function testGetLazyClosures()
|
||||
@ -75,7 +75,7 @@ class OptionsResolverIntrospectorTest extends TestCase
|
||||
$resolver->setDefined($option = 'foo');
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getLazyClosures($option));
|
||||
$debug->getLazyClosures($option);
|
||||
}
|
||||
|
||||
public function testGetLazyClosuresThrowsOnNotDefinedOption()
|
||||
@ -85,7 +85,7 @@ class OptionsResolverIntrospectorTest extends TestCase
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
$debug = new OptionsResolverIntrospector($resolver);
|
||||
$this->assertSame('bar', $debug->getLazyClosures('foo'));
|
||||
$debug->getLazyClosures('foo');
|
||||
}
|
||||
|
||||
public function testGetAllowedTypes()
|
||||
|
20
vendor/topthink/think-helper/src/Collection.php
vendored
20
vendor/topthink/think-helper/src/Collection.php
vendored
@ -353,7 +353,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
|
||||
return $this->filter(function ($data) use ($field, $operator, $value) {
|
||||
if (strpos($field, '.')) {
|
||||
list($field, $relation) = explode('.', $field);
|
||||
[$field, $relation] = explode('.', $field);
|
||||
|
||||
$result = $data[$field][$relation] ?? null;
|
||||
} else {
|
||||
@ -385,10 +385,10 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
case 'not in':
|
||||
return is_scalar($result) && !in_array($result, $value, true);
|
||||
case 'between':
|
||||
list($min, $max) = is_string($value) ? explode(',', $value) : $value;
|
||||
[$min, $max] = is_string($value) ? explode(',', $value) : $value;
|
||||
return is_scalar($result) && $result >= $min && $result <= $max;
|
||||
case 'not between':
|
||||
list($min, $max) = is_string($value) ? explode(',', $value) : $value;
|
||||
[$min, $max] = is_string($value) ? explode(',', $value) : $value;
|
||||
return is_scalar($result) && $result > $max || $result < $min;
|
||||
case '==':
|
||||
case '=':
|
||||
@ -473,11 +473,11 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
/**
|
||||
* 返回数据中指定的一列
|
||||
* @access public
|
||||
* @param string $columnKey 键名
|
||||
* @param string $indexKey 作为索引值的列
|
||||
* @param string|null $columnKey 键名
|
||||
* @param string|null $indexKey 作为索引值的列
|
||||
* @return array
|
||||
*/
|
||||
public function column(string $columnKey, string $indexKey = null)
|
||||
public function column(?string $columnKey, string $indexKey = null)
|
||||
{
|
||||
return array_column($this->items, $columnKey, $indexKey);
|
||||
}
|
||||
@ -509,13 +509,13 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
* @param string $order 排序
|
||||
* @return $this
|
||||
*/
|
||||
public function order(string $field, string $order = null)
|
||||
public function order(string $field, string $order = 'asc')
|
||||
{
|
||||
return $this->sort(function ($a, $b) use ($field, $order) {
|
||||
$fieldA = $a[$field] ?? null;
|
||||
$fieldB = $b[$field] ?? null;
|
||||
|
||||
return 'desc' == strtolower($order) ? strcmp($fieldB, $fieldA) : strcmp($fieldA, $fieldB);
|
||||
return 'desc' == strtolower($order) ? $fieldB > $fieldA : $fieldA > $fieldB;
|
||||
});
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最后一个单元数据
|
||||
* 获取最第一个单元数据
|
||||
*
|
||||
* @access public
|
||||
* @param callable|null $callback
|
||||
@ -548,7 +548,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第一个单元数据
|
||||
* 获取最后一个单元数据
|
||||
*
|
||||
* @access public
|
||||
* @param callable|null $callback
|
||||
|
2
vendor/zoujingli/think-library/composer.json
vendored
2
vendor/zoujingli/think-library/composer.json
vendored
@ -5,7 +5,7 @@
|
||||
"homepage": "http://framework.thinkadmin.top",
|
||||
"description": "ThinkPHP Basic Development Library",
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"php": ">=5.5",
|
||||
"ext-gd": "*",
|
||||
"ext-json": "*",
|
||||
"ext-curl": "*",
|
||||
|
@ -29,7 +29,7 @@ use think\Db;
|
||||
class ListenQueue extends Command
|
||||
{
|
||||
/**
|
||||
* 当前任务服务
|
||||
* 当前进程服务
|
||||
* @var ProcessService
|
||||
*/
|
||||
protected $process;
|
||||
@ -42,6 +42,16 @@ class ListenQueue extends Command
|
||||
$this->setName('xtask:listen')->setDescription('Start task listening main process');
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化进程服务
|
||||
* @param Input $input
|
||||
* @param Output $output
|
||||
*/
|
||||
protected function initialize(Input $input, Output $output)
|
||||
{
|
||||
$this->process = ProcessService::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行进程守护监听
|
||||
* @param Input $input
|
||||
@ -56,24 +66,24 @@ class ListenQueue extends Command
|
||||
{
|
||||
set_time_limit(0);
|
||||
Db::name('SystemQueue')->count();
|
||||
if (($process = ProcessService::instance())->iswin() && function_exists('cli_set_process_title')) {
|
||||
cli_set_process_title("ThinkAdmin {$process->version()} Queue Listen");
|
||||
if ($this->process->iswin() && function_exists('cli_set_process_title')) {
|
||||
cli_set_process_title("ThinkAdmin {$this->process->version()} Queue Listen");
|
||||
}
|
||||
$output->writeln('============ LISTENING ============');
|
||||
while (true) {
|
||||
$map = [['status', 'eq', '1'], ['time', '<=', time()]];
|
||||
foreach (Db::name('SystemQueue')->where($map)->order('time asc')->select() as $vo) {
|
||||
try {
|
||||
$command = $process->think("xtask:_work {$vo['id']} -");
|
||||
if (count($process->query($command)) > 0) {
|
||||
$command = $this->process->think("xtask:_work {$vo['id']} -");
|
||||
if (count($this->process->query($command)) > 0) {
|
||||
$this->output->writeln("Already in progress -> [{$vo['id']}] {$vo['title']}");
|
||||
} else {
|
||||
$process->create($command);
|
||||
$this->process->create($command);
|
||||
$this->output->writeln("Created new process -> [{$vo['id']}] {$vo['title']}");
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
Db::name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '4', 'desc' => $e->getMessage()]);
|
||||
$output->error("Execution failed -> [{$vo['id']}] {$vo['title']},{$e->getMessage()}");
|
||||
} catch (\Exception $exception) {
|
||||
Db::name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '4', 'desc' => $exception->getMessage()]);
|
||||
$output->error("Execution failed -> [{$vo['id']}] {$vo['title']},{$exception->getMessage()}");
|
||||
}
|
||||
}
|
||||
sleep(1);
|
||||
|
@ -30,21 +30,88 @@ class Express
|
||||
*/
|
||||
public static function query($code, $number)
|
||||
{
|
||||
if (in_array($code, ['debangkuaidi'])) $code = 'debangwuliu';
|
||||
list($microtime, $clientIp, $list) = [time(), request()->ip(), []];
|
||||
$options = ['header' => ['Host' => 'www.kuaidi100.com', 'CLIENT-IP' => $clientIp, 'X-FORWARDED-FOR' => $clientIp], 'cookie_file' => env('runtime_path') . 'temp/cookie'];
|
||||
$location = "https://sp0.baidu.com/9_Q4sjW91Qh3otqbppnN2DJv/pae/channel/data/asyncqury?cb=callback&appid=4001&com={$code}&nu={$number}&vcode=&token=&_={$microtime}";
|
||||
$result = json_decode(str_replace('/**/callback(', '', trim(http_get($location, [], $options), ')')), true);
|
||||
if (empty($result['data']['info']['context'])) { // 第一次可能失败,这里尝试第二次查询
|
||||
$result = json_decode(str_replace('/**/callback(', '', trim(http_get($location, [], $options), ')')), true);
|
||||
if (empty($result['data']['info']['context'])) {
|
||||
list($list, $cache) = [[], app()->cache->get($ckey = md5($code . $number))];
|
||||
if (!empty($cache)) return ['message' => 'ok', 'com' => $code, 'nu' => $number, 'data' => $cache];
|
||||
for ($i = 0; $i < 6; $i++) if (is_array($result = self::doExpress($code, $number))) {
|
||||
if (!empty($result['data']['info']['context'])) {
|
||||
foreach ($result['data']['info']['context'] as $vo) $list[] = [
|
||||
'time' => date('Y-m-d H:i:s', $vo['time']), 'context' => $vo['desc'],
|
||||
];
|
||||
app()->cache->set($ckey, $list, 10);
|
||||
return ['message' => 'ok', 'com' => $code, 'nu' => $number, 'data' => $list];
|
||||
}
|
||||
}
|
||||
foreach ($result['data']['info']['context'] as $vo) $list[] = [
|
||||
'time' => date('Y-m-d H:i:s', $vo['time']), 'ftime' => date('Y-m-d H:i:s', $vo['time']), 'context' => $vo['desc'],
|
||||
];
|
||||
return ['message' => 'ok', 'com' => $code, 'nu' => $number, 'data' => $list];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递公司列表
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public static function getExpressList($data = [])
|
||||
{
|
||||
if (preg_match('/"currentData":.*?\[(.*?)],/', self::getWapBaiduHtml(), $matches)) {
|
||||
foreach (json_decode("[{$matches['1']}]") as $item) $data[$item->value] = $item->text;
|
||||
unset($data['_auto']);
|
||||
return $data;
|
||||
} else {
|
||||
app()->cache->delete('express_kuaidi_html');
|
||||
return self::getExpressList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行百度快递100应用查询请求
|
||||
* @param string $code 快递公司编号
|
||||
* @param string $number 快递单单号
|
||||
* @return mixed
|
||||
*/
|
||||
private static function doExpress($code, $number)
|
||||
{
|
||||
list($api, $qid) = [self::getExpressQueryApi(), '7740' . Data::uniqidNumberCode(15)];
|
||||
$url = "{$api}&appid=4001&nu={$number}&com={$code}&qid={$qid}&new_need_di=1&source_xcx=0&vcode=&token=&sourceId=4155&cb=callback";
|
||||
return json_decode(str_replace('/**/callback(', '', trim(Http::get($url, [], self::getOption()), ')')), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递查询接口
|
||||
* @return string
|
||||
*/
|
||||
private static function getExpressQueryApi()
|
||||
{
|
||||
if (preg_match('/"expSearchApi":.*?"(.*?)",/', self::getWapBaiduHtml(), $matches)) {
|
||||
return str_replace('\\', '', $matches[1]);
|
||||
} else {
|
||||
app()->cache->delete('express_kuaidi_html');
|
||||
return self::getExpressQueryApi();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取百度WAP快递HTML
|
||||
* @return string
|
||||
*/
|
||||
private static function getWapBaiduHtml()
|
||||
{
|
||||
$content = app()->cache->get('express_kuaidi_html');
|
||||
while (empty($content) || stripos($content, '"expSearchApi":') === -1) {
|
||||
$uniqid = str_replace('.', '', microtime(true));
|
||||
$content = Http::get("https://m.baidu.com/s?word=快递查询&rand={$uniqid}", [], self::getOption());
|
||||
}
|
||||
app()->cache->set('express_kuaidi_html', $content, 30);
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取HTTP请求配置
|
||||
* @return array
|
||||
*/
|
||||
private static function getOption()
|
||||
{
|
||||
list($clentip, $cookies) = [request()->ip(), app()->getRuntimePath() . ".express.cookie"];
|
||||
$headers = ['Host:express.baidu.com', "CLIENT-IP:{$clentip}", "X-FORWARDED-FOR:{$clentip}"];
|
||||
return ['cookie_file' => $cookies, 'headers' => $headers];
|
||||
}
|
||||
|
||||
}
|
||||
|
80
vendor/zoujingli/wechat-developer/AliPay/Trade.php
vendored
Normal file
80
vendor/zoujingli/wechat-developer/AliPay/Trade.php
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace AliPay;
|
||||
|
||||
use WeChat\Contracts\BasicAliPay;
|
||||
|
||||
/**
|
||||
* 支付宝标准接口
|
||||
* Class Trade
|
||||
* @package AliPay
|
||||
*/
|
||||
class Trade extends BasicAliPay
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置交易接口地址
|
||||
* @param string $method
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->options->set('method', $method);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交易接口地址
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->options->get('method');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置接口公共参数
|
||||
* @param array $option
|
||||
* @return Trade
|
||||
*/
|
||||
public function setOption($option = [])
|
||||
{
|
||||
foreach ($option as $key => $vo) {
|
||||
$this->options->set($key, $vo);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接口公共参数
|
||||
* @return array|string|null
|
||||
*/
|
||||
public function getOption()
|
||||
{
|
||||
return $this->options->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行通过接口
|
||||
* @param array $options
|
||||
* @return array|boolean|mixed
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function apply($options)
|
||||
{
|
||||
return $this->getResult($options);
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@
|
||||
namespace AliPay;
|
||||
|
||||
use WeChat\Contracts\BasicAliPay;
|
||||
use WeChat\Exceptions\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* 支付宝转账到账户
|
||||
@ -46,6 +47,7 @@ class Transfer extends BasicAliPay
|
||||
*/
|
||||
public function create($options = [])
|
||||
{
|
||||
$this->setAppCertSnAndRootCertSn();
|
||||
$this->options->set('method', 'alipay.fund.trans.uni.transfer');
|
||||
return $this->getResult($options);
|
||||
}
|
||||
@ -59,6 +61,7 @@ class Transfer extends BasicAliPay
|
||||
*/
|
||||
public function queryResult($options = [])
|
||||
{
|
||||
$this->setAppCertSnAndRootCertSn();
|
||||
$this->options->set('method', 'alipay.fund.trans.common.query');
|
||||
return $this->getResult($options);
|
||||
|
||||
@ -73,7 +76,29 @@ class Transfer extends BasicAliPay
|
||||
*/
|
||||
public function queryAccount($options = [])
|
||||
{
|
||||
$this->setAppCertSnAndRootCertSn();
|
||||
$this->options->set('method', 'alipay.fund.account.query');
|
||||
return $this->getResult($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版 设置网关应用公钥证书SN、支付宝根证书SN
|
||||
*/
|
||||
protected function setAppCertSnAndRootCertSn()
|
||||
{
|
||||
if (!$this->config->get('app_cert')) {
|
||||
throw new InvalidArgumentException("Missing Config -- [app_cert]");
|
||||
}
|
||||
if (!$this->config->get('root_cert')) {
|
||||
throw new InvalidArgumentException("Missing Config -- [root_cert]");
|
||||
}
|
||||
$this->options->set('app_cert_sn', $this->getCertSN($this->config->get('app_cert')));
|
||||
$this->options->set('alipay_root_cert_sn', $this->getRootCertSN($this->config->get('root_cert')));
|
||||
if (!$this->options->get('app_cert_sn')) {
|
||||
throw new InvalidArgumentException("Missing options -- [app_cert_sn]");
|
||||
}
|
||||
if (!$this->options->get('alipay_root_cert_sn')) {
|
||||
throw new InvalidArgumentException("Missing options -- [alipay_root_cert_sn]");
|
||||
}
|
||||
}
|
||||
}
|
2
vendor/zoujingli/wechat-developer/README.md
vendored
2
vendor/zoujingli/wechat-developer/README.md
vendored
@ -40,7 +40,7 @@ WeChatDeveloper 为开源项目,允许把它用于任何地方,不受任何
|
||||
* Gitee 托管地址:https://gitee.com/zoujingli/WeChatDeveloper
|
||||
* GitHub 托管地址:https://github.com/zoujingli/WeChatDeveloper
|
||||
|
||||
文件说明
|
||||
文件说明(后缀会根据官方文档增加文件)
|
||||
----
|
||||
|
||||
|文件名|类名|描述|类型|加载 ①|
|
||||
|
27
vendor/zoujingli/wechat-developer/We.php
vendored
27
vendor/zoujingli/wechat-developer/We.php
vendored
@ -23,6 +23,15 @@ use WeChat\Exceptions\InvalidInstanceException;
|
||||
* @author Anyon<zoujingli@qq.com>
|
||||
* @date 2018/05/24 13:23
|
||||
*
|
||||
* ----- AliPay ----
|
||||
* @method \AliPay\App AliPayApp($options) static 支付宝App支付网关
|
||||
* @method \AliPay\Bill AliPayBill($options) static 支付宝电子面单下载
|
||||
* @method \AliPay\Pos AliPayPos($options) static 支付宝刷卡支付
|
||||
* @method \AliPay\Scan AliPayScan($options) static 支付宝扫码支付
|
||||
* @method \AliPay\Transfer AliPayTransfer($options) static 支付宝转账到账户
|
||||
* @method \AliPay\Wap AliPayWap($options) static 支付宝手机网站支付
|
||||
* @method \AliPay\Web AliPayWeb($options) static 支付宝网站支付
|
||||
*
|
||||
* ----- WeChat -----
|
||||
* @method \WeChat\Card WeChatCard($options = []) static 微信卡券管理
|
||||
* @method \WeChat\Custom WeChatCustom($options = []) static 微信客服消息
|
||||
@ -45,13 +54,18 @@ use WeChat\Exceptions\InvalidInstanceException;
|
||||
* ----- WeMini -----
|
||||
* @method \WeMini\Crypt WeMiniCrypt($options = []) static 小程序数据加密处理
|
||||
* @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送
|
||||
* @method \WeMini\Guide WeMiniGuide($options = []) static 小程序导购助手
|
||||
* @method \WeMini\Image WeMiniImage($options = []) static 小程序图像处理
|
||||
* @method \WeMini\Live WeMiniLive($options = []) static 小程序直播接口
|
||||
* @method \WeMini\Logistics WeMiniLogistics($options = []) static 小程序物流助手
|
||||
* @method \WeMini\Message WeMiniMessage($options = []) static 小程序动态消息
|
||||
* @method \WeMini\Newtmpl WeMiniNewtmpl($options = []) static 小程序订阅消息
|
||||
* @method \WeMini\Ocr WeMiniOcr($options = []) static 小程序ORC服务
|
||||
* @method \WeMini\Operation WeMiniOperation($options = []) static 小程序运维中心
|
||||
* @method \WeMini\Plugs WeMiniPlugs($options = []) static 小程序插件管理
|
||||
* @method \WeMini\Poi WeMiniPoi($options = []) static 小程序地址管理
|
||||
* @method \WeMini\Qrcode WeMiniQrcode($options = []) static 小程序二维码管理
|
||||
* @method \WeMini\Search WeMiniSearch($options = []) static 小程序搜索
|
||||
* @method \WeMini\Security WeMiniSecurity($options = []) static 小程序内容安全
|
||||
* @method \WeMini\Soter WeMiniSoter($options = []) static 小程序生物认证
|
||||
* @method \WeMini\Template WeMiniTemplate($options = []) static 小程序模板消息支持
|
||||
@ -59,21 +73,12 @@ use WeChat\Exceptions\InvalidInstanceException;
|
||||
*
|
||||
* ----- WePay -----
|
||||
* @method \WePay\Bill WePayBill($options = []) static 微信商户账单及评论
|
||||
* @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券
|
||||
* @method \WePay\Order WePayOrder($options = []) static 微信商户订单
|
||||
* @method \WePay\Refund WePayRefund($options = []) static 微信商户退款
|
||||
* @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券
|
||||
* @method \WePay\Redpack WePayRedpack($options = []) static 微信红包支持
|
||||
* @method \WePay\Transfers WePayTransfers($options = []) static 微信商户打款到零钱
|
||||
* @method \WePay\TransfersBank WePayTransfersBank($options = []) static 微信商户打款到银行卡
|
||||
*
|
||||
* ----- AliPay ----
|
||||
* @method \AliPay\App AliPayApp($options) static 支付宝App支付网关
|
||||
* @method \AliPay\Bill AliPayBill($options) static 支付宝电子面单下载
|
||||
* @method \AliPay\Pos AliPayPos($options) static 支付宝刷卡支付
|
||||
* @method \AliPay\Scan AliPayScan($options) static 支付宝扫码支付
|
||||
* @method \AliPay\Transfer AliPayTransfer($options) static 支付宝转账到账户
|
||||
* @method \AliPay\Wap AliPayWap($options) static 支付宝手机网站支付
|
||||
* @method \AliPay\Web AliPayWeb($options) static 支付宝网站支付
|
||||
*/
|
||||
class We
|
||||
{
|
||||
@ -81,7 +86,7 @@ class We
|
||||
* 定义当前版本
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '1.2.17';
|
||||
const VERSION = '1.2.21';
|
||||
|
||||
/**
|
||||
* 静态配置
|
||||
|
@ -198,7 +198,7 @@ abstract class BasicAliPay
|
||||
*/
|
||||
protected function getSign()
|
||||
{
|
||||
$content = wordwrap($this->config->get('private_key'), 64, "\n", true);
|
||||
$content = wordwrap($this->trimCert($this->config->get('private_key')), 64, "\n", true);
|
||||
$string = "-----BEGIN RSA PRIVATE KEY-----\n{$content}\n-----END RSA PRIVATE KEY-----";
|
||||
if ($this->options->get('sign_type') === 'RSA2') {
|
||||
openssl_sign($this->getSignContent($this->options->get(), true), $sign, $string, OPENSSL_ALGO_SHA256);
|
||||
@ -208,6 +208,17 @@ abstract class BasicAliPay
|
||||
return base64_encode($sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除证书前后内容及空白
|
||||
* @param string $sign
|
||||
* @return string
|
||||
*/
|
||||
protected function trimCert($sign)
|
||||
{
|
||||
// if (file_exists($sign)) $sign = file_get_contents($sign);
|
||||
return preg_replace(['/\s+/', '/\-{5}.*?\-{5}/'], '', $sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据签名处理
|
||||
* @param array $data 需要进行签名数据
|
||||
@ -276,6 +287,75 @@ abstract class BasicAliPay
|
||||
return "{$html}<script>document.forms['alipaysubmit'].submit();</script>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版 从证书中提取序列号
|
||||
* @param string $sign
|
||||
* @return string
|
||||
*/
|
||||
public function getCertSN($sign)
|
||||
{
|
||||
// if (file_exists($sign)) $sign = file_get_contents($sign);
|
||||
$ssl = openssl_x509_parse($sign);
|
||||
return md5($this->_arr2str(array_reverse($ssl['issuer'])) . $ssl['serialNumber']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版 提取根证书序列号
|
||||
* @param string $sign
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRootCertSN($sign)
|
||||
{
|
||||
$sn = null;
|
||||
// if (file_exists($sign)) $sign = file_get_contents($sign);
|
||||
$array = explode("-----END CERTIFICATE-----", $sign);
|
||||
for ($i = 0; $i < count($array) - 1; $i++) {
|
||||
$ssl[$i] = openssl_x509_parse($array[$i] . "-----END CERTIFICATE-----");
|
||||
if (strpos($ssl[$i]['serialNumber'], '0x') === 0) {
|
||||
$ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumber']);
|
||||
}
|
||||
if ($ssl[$i]['signatureTypeLN'] == "sha1WithRSAEncryption" || $ssl[$i]['signatureTypeLN'] == "sha256WithRSAEncryption") {
|
||||
if ($sn == null) {
|
||||
$sn = md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
|
||||
} else {
|
||||
$sn = $sn . "_" . md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $sn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版 数组转字符串
|
||||
* @param array $array
|
||||
* @return string
|
||||
*/
|
||||
private function _arr2str($array)
|
||||
{
|
||||
$string = [];
|
||||
if ($array && is_array($array)) {
|
||||
foreach ($array as $key => $value) {
|
||||
$string[] = $key . '=' . $value;
|
||||
}
|
||||
}
|
||||
return implode(',', $string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新版 0x转高精度数字
|
||||
* @param string $hex
|
||||
* @return int|string
|
||||
*/
|
||||
private function _hex2dec($hex)
|
||||
{
|
||||
list($dec, $len) = [0, strlen($hex)];
|
||||
for ($i = 1; $i <= $len; $i++) {
|
||||
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
|
||||
}
|
||||
return $dec;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用数据操作
|
||||
* @param array $options
|
||||
|
@ -164,10 +164,21 @@ class Tools
|
||||
return json_decode(json_encode($data), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析XML文本内容
|
||||
* @param string $xml
|
||||
* @return boolean|mixed
|
||||
*/
|
||||
public static function xml3arr($xml)
|
||||
{
|
||||
$state = xml_parse($parser = xml_parser_create(), $xml, true);
|
||||
return xml_parser_free($parser) && $state ? self::xml2arr($xml) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组转xml内容
|
||||
* @param array $data
|
||||
* @return null|string|string
|
||||
* @return null|string
|
||||
*/
|
||||
public static function arr2json($data)
|
||||
{
|
||||
|
547
vendor/zoujingli/wechat-developer/WeMini/Guide.php
vendored
Normal file
547
vendor/zoujingli/wechat-developer/WeMini/Guide.php
vendored
Normal file
@ -0,0 +1,547 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace WeMini;
|
||||
|
||||
use WeChat\Contracts\BasicWeChat;
|
||||
|
||||
/**
|
||||
* 小程序导购助手
|
||||
* Class Guide
|
||||
* @package WeMini
|
||||
*/
|
||||
class Guide extends BasicWeChat
|
||||
{
|
||||
/**
|
||||
* 服务号添加导购
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function addGuideAcct($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/addguideacct?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务号删除导购
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideAcct($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguideacct?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务号获取导购信息
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideAcct($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务号的敏感词信息与自动回复信息
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideAcctConfig()
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacctconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, [], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务号拉取导购列表
|
||||
* @param integer $page
|
||||
* @param integer $num
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideAcctList($page = 0, $num = 10)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacctconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['page' => $page, 'num' => $num], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导购聊天记录
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerChatRecord($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导购快捷回复信息
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideConfig($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成导购二维码
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function guideCreateQrCode($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/guidecreateqrcode?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function pushShowWxaPathMenu($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/pushshowwxapathmenu?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为服务号设置敏感词与自动回复
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function setGuideAcctConfig($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideacctconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置导购快捷回复信息
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function setGuideConfig($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新导购昵称或者头像
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function updateGuideAcct($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideconfig?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加展示标签信息
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function addGuideBuyerDisplayTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyerdisplaytag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为粉丝添加可查询标签
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function addGuideBuyerTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyertag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加标签可选值
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function addGuideTagOption($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidetagoption?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除粉丝标签
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideBuyerTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidebuyertag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展示标签信息
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerDisplayTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerdisplaytag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询粉丝标签
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyertag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签可选值信息
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideTagOption()
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidetagoption?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, [], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建可查询标签类型,支持新建4类可查询标签
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function newGuideTagOption($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/newguidetagoption?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签值筛选粉丝
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function queryGuideBuyerByTag($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/queryguidebuyerbytag?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为服务号导购添加粉丝
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function addGuideBuyerRelation($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/addguidebuyerrelation?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除导购的粉丝
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideBuyerRelation($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidebuyerrelation?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某一个粉丝与导购的绑定关系
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerRelation($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelation?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过粉丝信息查询该粉丝与导购的绑定关系
|
||||
* @param string $openid
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerRelationByBuyer($openid)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelation?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['openid' => $openid], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取导购的粉丝列表
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideBuyerRelationList($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelationlist?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将粉丝从一个导购迁移到另外一个导购下
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function rebindGuideAcctForBuyer($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/rebindguideacctforbuyer?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新粉丝昵称
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function updateGuideBuyerRelation($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/updateguidebuyerrelation?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小程序卡片素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideCardMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidecardmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideImageMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguideimagematerial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文字素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function delGuideWordMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/delguidewordmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小程序卡片素材信息
|
||||
* @param integer $type
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideCardMaterial($type = 0)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidecardmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['type' => $type], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片素材信息
|
||||
* @param integer $type 操作类型
|
||||
* @param integer $start 分页查询,起始位置
|
||||
* @param integer $num 分页查询,查询个数
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideImageMaterial($type = 0, $start = 0, $num = 10)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideimagematerial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['type' => $type, 'start' => $start, 'num' => $num], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文字素材信息
|
||||
* @param integer $type 操作类型
|
||||
* @param integer $start 分页查询,起始位置
|
||||
* @param integer $num 分页查询,查询个数
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getGuideWordMaterial($type = 0, $start = 0, $num = 10)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguidewordmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['type' => $type, 'start' => $start, 'num' => $num], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小程序卡片素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function setGuideCardMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguidecardmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加图片素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function setGuideImageMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguideimagematerial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为服务号添加文字素材
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function setGuideWordMaterial($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/setguidewordmaterial?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
}
|
56
vendor/zoujingli/wechat-developer/WeMini/Live.php
vendored
Normal file
56
vendor/zoujingli/wechat-developer/WeMini/Live.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace WeMini;
|
||||
|
||||
use WeChat\Contracts\BasicWeChat;
|
||||
|
||||
/**
|
||||
* 小程序直播接口
|
||||
* Class Live
|
||||
* @package WeMini
|
||||
*/
|
||||
class Live extends BasicWeChat
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取直播房间列表
|
||||
* @param integer $start 起始拉取房间
|
||||
* @param integer $limit 每次拉取的个数上限
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getLiveList($start = 0, $limit = 10)
|
||||
{
|
||||
$url = 'http://api.weixin.qq.com/wxa/business/getliveinfo?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['start' => $start, 'limit' => $limit], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取回放源视频
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function getLiveInfo($data = [])
|
||||
{
|
||||
$url = 'http://api.weixin.qq.com/wxa/business/getliveinfo?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
}
|
@ -74,7 +74,7 @@ class Newtmpl extends BasicWeChat
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatetitles?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['ids'=>$ids,'start' => '0', 'limit' => '30'], true);
|
||||
return $this->callPostApi($url, ['ids' => $ids, 'start' => '0', 'limit' => '30'], true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
41
vendor/zoujingli/wechat-developer/WeMini/Operation.php
vendored
Normal file
41
vendor/zoujingli/wechat-developer/WeMini/Operation.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace WeMini;
|
||||
|
||||
use WeChat\Contracts\BasicWeChat;
|
||||
|
||||
/**
|
||||
* 小程序运维中心
|
||||
* Class Operation
|
||||
* @package WeMini
|
||||
*/
|
||||
class Operation extends BasicWeChat
|
||||
{
|
||||
|
||||
/**
|
||||
* 实时日志查询
|
||||
* @param array $data
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function realtimelogSearch($data)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/wxaapi/userlog/userlog_search?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, $data, true);
|
||||
}
|
||||
|
||||
}
|
40
vendor/zoujingli/wechat-developer/WeMini/Search.php
vendored
Normal file
40
vendor/zoujingli/wechat-developer/WeMini/Search.php
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网站: http://think.ctolog.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | 开源协议 ( https://mit-license.org )
|
||||
// +----------------------------------------------------------------------
|
||||
// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace WeMini;
|
||||
|
||||
use WeChat\Contracts\BasicWeChat;
|
||||
|
||||
/**
|
||||
* 小程序搜索
|
||||
* Class Search
|
||||
* @package WeMini
|
||||
*/
|
||||
class Search extends BasicWeChat
|
||||
{
|
||||
/**
|
||||
* 提交小程序页面url及参数信息
|
||||
* @param array $pages
|
||||
* @return array
|
||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||
* @throws \WeChat\Exceptions\LocalCacheException
|
||||
*/
|
||||
public function submitPages($pages)
|
||||
{
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/guide/getguideacct?access_token=ACCESS_TOKEN';
|
||||
$this->registerApi($url, __FUNCTION__, func_get_args());
|
||||
return $this->callPostApi($url, ['pages' => $pages], true);
|
||||
}
|
||||
|
||||
}
|
@ -39,7 +39,7 @@ class Bill extends BasicWePay
|
||||
$params = $this->params->merge($options);
|
||||
$params['sign'] = $this->getPaySign($params, 'MD5');
|
||||
$result = Tools::post('https://api.mch.weixin.qq.com/pay/downloadbill', Tools::arr2xml($params));
|
||||
if (($jsonData = Tools::xml2arr($result))) {
|
||||
if (is_array($jsonData = Tools::xml3arr($result))) {
|
||||
if ($jsonData['return_code'] !== 'SUCCESS') {
|
||||
throw new InvalidResponseException($jsonData['return_msg'], '0');
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ try {
|
||||
|
||||
// 参考链接:https://docs.open.alipay.com/api_1/alipay.trade.refund
|
||||
$result = $pay->refund($out_trade_no, $refund_fee);
|
||||
|
||||
|
||||
echo '<pre>';
|
||||
var_export($result);
|
||||
} catch (Exception $e) {
|
||||
|
@ -19,10 +19,14 @@ return [
|
||||
'sign_type' => "RSA2",
|
||||
// 应用ID
|
||||
'appid' => '2016090900468879',
|
||||
// 支付宝公钥(1行填写,特别注意,这里是支付宝公钥,不是应用公钥,最好从开发者中心的网页上去复制)
|
||||
// 支付宝公钥 (1行填写,特别注意,这里是支付宝公钥,不是应用公钥,最好从开发者中心的网页上去复制)
|
||||
'public_key' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtU71NY53UDGY7JNvLYAhsNa+taTF6KthIHJmGgdio9bkqeJGhHk6ttkTKkLqFgwIfgAkHpdKiOv1uZw6gVGZ7TCu5LfHTqKrCd6Uz+N7hxhY+4IwicLgprcV1flXQLmbkJYzFMZqkXGkSgOsR2yXh4LyQZczgk9N456uuzGtRy7MoB4zQy34PLUkkxR6W1B2ftNbLRGXv6tc7p/cmDcrY6K1bSxnGmfRxFSb8lRfhe0V0UM6pKq2SGGSeovrKHN0OLp+Nn5wcULVnFgATXGCENshRlp96piPEBFwneXs19n+sX1jx60FTR7/rME3sW3AHug0fhZ9mSqW4x401WjdnwIDAQAB',
|
||||
// 支付宝私钥(1行填写)
|
||||
// 支付宝私钥 (1行填写)
|
||||
'private_key' => 'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC3pbN7esinxgjE8uxXAsccgGNKIq+PR1LteNTFOy0fsete43ObQCrzd9DO0zaUeBUzpIOnxrKxez7QoZROZMYrinttFZ/V5rbObEM9E5AR5Tv/Fr4IBywoS8ZtN16Xb+fZmibfU91yq9O2RYSvscncU2qEYmmaTenM0QlUO80ZKqPsM5JkgCNdcYZTUeHclWeyER3dSImNtlSKiSBSSTHthb11fkudjzdiUXua0NKVWyYuAOoDMcpXbD6NJmYqEA/iZ/AxtQt08pv0Mow581GPB0Uop5+qA2hCV85DpagE94a067sKcRui0rtkJzHem9k7xVL+2RoFm1fv3RnUkMwhAgMBAAECggEAAetkddzxrfc+7jgPylUIGb8pyoOUTC4Vqs/BgZI9xYAJksNT2QKRsFvHPfItNt4Ocqy8h4tnIL3GCU43C564B4p6AcjhE85GiN/O0BudPOKlfuQQ9mqExqMMHuYeQfz0cmzPDTSGMwWiv9v4KBH2pyvkCCAzNF6uG+rvawb4/NNVuiI7C8Ku/wYsamtbgjMZVOFFdScYgIw1BgA99RUU/fWBLMnTQkoyowSRb9eSmEUHjt/WQt+/QgKAT2WmuX4RhaGy0qcQLbNaJNKXdJ+PVhQrSiasINNtqYMa8GsQuuKsk3X8TCg9K6/lowivt5ruhyWcP2sx93zY/LGzIHgHcQKBgQDoZlcs9RWxTdGDdtH8kk0J/r+QtMijNzWI0a+t+ZsWOyd3rw+uM/8O4JTNP4Y98TvvxhJXewITbfiuOIbW1mxh8bnO/fcz7+RXZKgPDeoTeNo717tZFZGBEyUdH9M9Inqvht7+hjVDIMCYBDomYebdk3Xqo4mDBjLRdVNGrhGmVQKBgQDKS/MgTMK8Ktfnu1KzwCbn/FfHTOrp1a1t1wWPv9AW0rJPYeaP6lOkgIoO/1odG9qDDhdB6njqM+mKY5Yr3N94PHamHbwJUCmbkqEunCWpGzgcQZ1Q254xk9D7UKq/XUqW2WDqDq80GQeNial+fBc46yelQzokwdA+JdIFKoyinQKBgQCBems9V/rTAtkk1nFdt6EGXZEbLS3PiXXhGXo4gqV+OEzf6H/i/YMwJb2hsK+5GQrcps0XQihA7PctEb9GOMa/tu5fva0ZmaDtc94SLR1p5d4okyQFGPgtIp594HpPSEN0Qb9BrUJFeRz0VP6U3dzDPGHo7V4yyqRLgIN6EIcy1QKBgAqdh6mHPaTAHspDMyjJiYEc5cJIj/8rPkmIQft0FkhMUB0IRyAALNlyAUyeK61hW8sKvz+vPR8VEEk5xpSQp41YpuU6pDZc5YILZLfca8F+8yfQbZ/jll6Foi694efezl4yE/rUQG9cbOAJfEJt4o4TEOaEK5XoMbRBKc8pl22lAoGARTq0qOr9SStihRAy9a+8wi2WEwL4QHcmOjH7iAuJxy5b5TRDSjlk6h+0dnTItiFlTXdfpO8KhWA8EoSJVBZ1kcACQDFgMIA+VM+yXydtzMotOn21W4stfZ4I6dHFiujMsnKpNYVpQh3oCrJf4SeXiQDdiSCodqb1HlKkEc6naHQ=',
|
||||
// 应用公钥证书(新版资金类接口转 app_cert_sn)
|
||||
'app_cert' => '',
|
||||
// 支付宝根证书(新版资金类接口转 alipay_root_cert_sn)
|
||||
'root_cert' => '',
|
||||
// 支付成功通知地址
|
||||
'notify_url' => '',
|
||||
// 网页支付回跳地址
|
||||
|
@ -8,7 +8,7 @@
|
||||
{
|
||||
"name": "Anyon",
|
||||
"email": "zoujingli@qq.com",
|
||||
"homepage": "http://ctolog.com"
|
||||
"homepage": "https://thinkadmin.top"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
@ -21,8 +21,10 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"ext-xml": "*",
|
||||
"ext-json": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-bcmath": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-mbstring": "*",
|
||||
@ -34,8 +36,8 @@
|
||||
],
|
||||
"psr-4": {
|
||||
"WePay\\": "WePay",
|
||||
"WeMini\\": "WeMini",
|
||||
"WeChat\\": "WeChat",
|
||||
"WeMini\\": "WeMini",
|
||||
"AliPay\\": "AliPay"
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ spl_autoload_register(function ($classname) {
|
||||
$pathname = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
$filename = str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
|
||||
if (file_exists($pathname . $filename)) {
|
||||
foreach (['WeChat', 'WeMini', 'AliPay', 'WePay', 'We'] as $prefix) {
|
||||
foreach (['AliPay', 'WeChat', 'WeMini', 'WePay', 'We'] as $prefix) {
|
||||
if (stripos($classname, $prefix) === 0) {
|
||||
include $pathname . $filename;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user