Commit 45987396 authored by pengfei's avatar pengfei

Merge branch 'colonel' into develop

parents eb2fd3c8 0201a347
......@@ -22,5 +22,8 @@ class UserException extends BaseException
8 => '绑定手机号失败',
9 => '该手机号已绑定其他用户不能重复绑定',
10 => 'mysql 异常',
11 => '头像昵称更新失败',
12 => '绑定手机号保存失败',
13 => '请求太频繁,稍后重试',
];
}
\ No newline at end of file
......@@ -26,6 +26,14 @@ class UserWechatBind extends MysqlBase
return self::get($columns, $where);
}
public static function getRecordMaster($where, $columns = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::getMaster($columns, $where);
}
public static function getRecords($where, $columns = [])
{
if (empty($columns)) {
......@@ -34,7 +42,7 @@ class UserWechatBind extends MysqlBase
return self::select($columns, $where);
}
public static function getRecordMaster($where, $columns = [])
public static function getRecordsMaster ($where, $columns = [])
{
if (empty($columns)) {
$columns = '*';
......
......@@ -7,7 +7,6 @@
use App\Base\Job;
use Api\PhpServices\Idgen\Idgen;
use Api\PhpUtils\Log\FileLog;
use App\Models\marketing\mysql\ColonelDistributorColonel;
use App\Models\marketing\mysql\ColonelDistributorConfig;
use App\Models\marketing\mysql\ColonelDistributorInviteOrderNum;
......@@ -16,6 +15,7 @@ use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\HttpUtil;
use App\Models\user\mysql\UserWechatBind;
use App\Services\marketing\PindanActivityColonelConfigService;
use Api\PhpUtils\Log\JobLog;
class ColonelorderController extends Job
{
......@@ -83,7 +83,7 @@ class ColonelorderController extends Job
if (!ColonelDistributorPayInfo::commit()) {
throw new Exception(sprintf("事务提交失败 %s", json_encode($data)));
}
$this->loggerError('success');
$this->loggerInfo('success');
} catch (Exception $e) {
ColonelDistributorPayInfo::rollback();
$this->loggerError('error=' . $e->getMessage());
......@@ -101,7 +101,7 @@ class ColonelorderController extends Job
*/
private function getInviteNewUserData($userIds, &$colonelPayInfoData)
{
if ($inviteNewUserList = $this->getInviteNewUserList($userIds,$this->startTime,$this->endTime)) {
if ($inviteNewUserList = $this->getInviteNewUserList($userIds, $this->startTime, $this->endTime)) {
$userNickList = $this->getUserList(array_column($inviteNewUserList, 'user_id'));
foreach ($inviteNewUserList as $newUser) {
$colonelPayInfoData[] = [
......@@ -155,7 +155,7 @@ class ColonelorderController extends Job
{
$config = ColonelDistributorConfig::getRecord([
'date[<=]' => $settlementDate,
'type' => ColonelDistributorConfig::TYPE_COLONEL,
'type' => ColonelDistributorConfig::TYPE_COLONEL,
'ORDER' => ['date' => 'DESC'],
'LIMIT' => 1
]);
......@@ -193,7 +193,7 @@ class ColonelorderController extends Job
* @return array
* @throws InterfaceException
*/
private function getInviteNewUserList($userIds,$startTime,$endTime): array
private function getInviteNewUserList($userIds, $startTime, $endTime): array
{
$url = config('interface', 'coupon.background.wx_invite_relation_list_by_user_ids');
if (empty($url)) {
......@@ -227,7 +227,7 @@ class ColonelorderController extends Job
]);
$ids = $res['id_datetime']['goods'] ?? [];
foreach ($data as $key => $item) {
$data[$key]['colonel_distributor_pay_info_id'] = $ids[$key];
$data[$key]['only_pay_info_id'] = $ids[$key];
}
return $data;
}
......@@ -265,7 +265,7 @@ class ColonelorderController extends Job
*/
private function loggerInfo($log)
{
FileLog::info('colonel_distributor_order', 'colonel_distributor_order:' . $log, false, true);
JobLog::getInstance()->info('colonel_distributor_order', $log)->output();
}
/**
......@@ -276,6 +276,6 @@ class ColonelorderController extends Job
*/
private function loggerError($log)
{
FileLog::error('colonel_distributor_order', $log, null, 'bp-server@yidian-inc.com', true);
JobLog::getInstance()->error('colonel_distributor_order', $log, null, 'bp-server@yidian-inc.com')->output();
}
}
......@@ -6,10 +6,10 @@
*/
use App\Base\Job;
use Api\PhpUtils\Log\FileLog;
use App\Models\marketing\mysql\ColonelDistributorPayInfo;
use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\HttpUtil;
use Api\PhpUtils\Log\JobLog;
class ColonelwalletController extends Job
{
......@@ -35,7 +35,7 @@ class ColonelwalletController extends Job
if ($this->handlePayInfoStatus(array_column($payInfoList, 'pay_info_id'))) {
$this->loggerInfo('success');
} else {
$this->loggerInfo('更新状态失败');
$this->loggerError('更新状态失败');
}
}
}
......@@ -63,7 +63,7 @@ class ColonelwalletController extends Job
'user_id' => $payInfo['colonel_user_id'],
'service_name' => self::WALLET_SERVICE_NAME,
'source_name' => self::WALLET_SOURCE_NAME,
'third_order_id' => $payInfo['colonel_distributor_pay_info_id'],
'third_order_id' => $payInfo['only_pay_info_id'],
'third_order_id_type' => $payInfo['type'],
'third_order_desc' => self::getThirdOrderDesc($payInfo),
'amount' => $payInfo['reward'],
......@@ -105,7 +105,7 @@ class ColonelwalletController extends Job
'op' => self::CAPITAL_POOL_OP,
'user_id' => $payInfo['colonel_user_id'],
'amount' => $payInfo['reward'],
'third_order_id' => $payInfo['colonel_distributor_pay_info_id'],
'third_order_id' => $payInfo['only_pay_info_id'],
'third_order_id_type' => $payInfo['type'],
'third_order_desc' => self::getThirdOrderDesc($payInfo),
];
......@@ -133,7 +133,7 @@ class ColonelwalletController extends Job
// TODO 此处看后期业务发展 看是否需要封装WalletSdk
$date = date('Y-m-d H:i:s');
return [
'transfer_service_id' => '', //TODO
'transfer_service_id' => appConfig('colonel.wallet.transfer_service_id'),
'sign' => self::getWalletHttpSign($date),
'time' => $date
];
......@@ -148,8 +148,7 @@ class ColonelwalletController extends Job
*/
private function getWalletHttpSign($date): string
{
$transfer_service_secret = ''; //TODO
return md5($date . $transfer_service_secret);
return md5($date . appConfig('colonel.wallet.transfer_service_secret'));
}
/**
......@@ -202,7 +201,7 @@ class ColonelwalletController extends Job
*/
private function loggerInfo($log)
{
FileLog::info('colonel_distributor_wallet', 'colonel_distributor_wallet:' . $log, false, true);
JobLog::getInstance()->info('colonel_distributor_wallet', $log, false)->output();
}
/**
......@@ -213,6 +212,6 @@ class ColonelwalletController extends Job
*/
private function loggerError($log)
{
FileLog::error('colonel_distributor_wallet', $log, null, 'bp-server@yidian-inc.com', true);
JobLog::getInstance()->error('colonel_distributor_wallet', $log, null, 'bp-server@yidian-inc.com')->output();
}
}
......@@ -157,11 +157,6 @@ class GoodsService
throw new GoodsException(['cus' => 2]);
}
$spuId = $res[0];
$checkName = self::checkGoodsName($spuData["goods_name"], $spuData["life_account_id"]);
if (!$checkName["can_use"]) {
throw new GoodsException(['cus' => 17]);
}
$spuParams = [
"goods_spu_id" => $spuId,
"shop_id" => $shopId,
......@@ -771,13 +766,6 @@ class GoodsService
*/
private static function editGoodsSpu($goodsSpu, $params = [])
{
$checkName = self::checkGoodsName($params["goods_name"], $goodsSpu["life_account_id"], $goodsSpu["goods_spu_id"]);
if (!$checkName["can_use"]) {
throw new GoodsException(['cus' => 17]);
}
return GoodsSpu::save([
"goods_name" => $params["goods_name"],
"desc_pic_url" => $params["desc_pic_url"],
......
......@@ -165,12 +165,6 @@ class MarketingPindanGoodsService
*/
private static function addGoodsSku($spuData, $shopId, $skuData = [])
{
$pindanSku = PindanGoodsSku::get("goods_sku_id", ["goods_name" => $skuData["goods_name"]
, "life_account_id" => $skuData["life_account_id"]]);
if (!empty($pindanSku)) {
throw new GoodsException(['cus' => 17]);
}
$res = GoodsService::getIdgenId(substr($shopId, -2), "goods");
if (empty($res)) {
throw new GoodsException(['cus' => 2]);
......@@ -267,11 +261,6 @@ class MarketingPindanGoodsService
*/
private static function editGoodsSpu($goodsSpu, $params = [])
{
$checkName = GoodsService::checkGoodsName($params["goods_name"], $goodsSpu["life_account_id"], $goodsSpu["goods_spu_id"]);
if (!$checkName["can_use"]) {
throw new GoodsException(['cus' => 17]);
}
return GoodsSpu::save([
"desc_pic_url" => $params["desc_pic_url"],
"desc" => $params["desc"],
......
......@@ -4,6 +4,7 @@ namespace App\Services\marketing;
use App\Exception\custom\MarketingException;
use App\Models\marketing\mysql\ColonelDistributorColonel;
use App\Models\marketing\mysql\ColonelDistributorConfig;
use App\Models\marketing\mysql\ColonelDistributorInviteOrder;
use App\Models\marketing\mysql\ColonelDistributorInviteOrderNum;
use App\Models\marketing\mysql\ColonelDistributorPayInfo;
......@@ -122,6 +123,81 @@ class PindanActivityInviteOrderService
return $data;
}
/**
* 未结算收益
* @param $userIds
*/
private static function noSettlementStatistics($userIds)
{
$timeRange = self::getNoSettlementTimeRange();
$inviteOrderNumList = ColonelDistributorInviteOrderNum::select(["colonel_user_id", "num", "date"], [
"create_time[>]" => $timeRange["start_time"],
"create_time[<]" => $timeRange["end_time"],
], []);
if (!empty($inviteOrderNumList)) {
foreach ($inviteOrderNumList as $inviteOrderNum) {
}
}
}
/**
* 获取未结算收益的时间段
* @return array|string[]
*/
public static function getNoSettlementTimeRange() : array
{
// 获取活动时间范围
// 例如当前时间(2021-09-03 11:00:00) 应结算时间为 2021-08-31 12:00:00 ~ 2021-09-03:12:00:00
// 例如当前时间(2021-09-03 13:00:00) 应结算时间为 2021-09-01 12:00:00 ~ 2021-09-03:12:00:00
$nowHour = date("H");
$hour = ' '.PindanActivityColonelConfigService::ACTIVITY_DEFAULT_HOUR . ':00:00';
if ($nowHour < 12) {
$startTime = date('Y-m-d', strtotime('-3 day')).$hour;
} else {
$startTime = date('Y-m-d', strtotime('-2 day')).$hour;
}
$endTime = date("Y-m-d").$hour;
return [
'start_time' => $startTime,
'end_time' => $endTime,
];
}
/**
* 指定日期的团长配置
* @param $date
* @return array|mixed
*/
private static function getColonelConfig($date)
{
$config = ColonelDistributorConfig::getRecord([
'date' => $date,
'type' => ColonelDistributorConfig::TYPE_COLONEL
]);
if (empty($config)) {
$config = ColonelDistributorConfig::getRecord([
'date[<=]' => $date,
'ORDER' => ['date' => 'DESC'],
'LIMIT' => 1
]);
}
$configData = [];
if (empty($config['data'])) {
$configData = json_decode($config['data'], true);
}
return $configData;
}
/**
* 团长分销,昨日转化单数,总转化单数
* @param array $params
......
......@@ -14,6 +14,8 @@ use Api\PhpServices\Idgen\Idgen;
use Api\PhpUtils\Redis\RedisUtil;
use Api\PhpServices\JwUser\JwUser;
use App\Services\common\CommonService;
use Api\PhpUtils\Log\FileLog;
use Api\PhpUtils\Lock\FrequencyLockUtil;
class UserService
{
......@@ -23,13 +25,14 @@ class UserService
public static function wechatLogin($params)
{
$code = !empty($params['code']) ? $params['code'] : '';//小程序授权code
$openid = !empty($params['openid']) ? $params['openid'] : '';//小程序授权code
if (empty($code) && empty($openid)) {
FileLog::error("wechatLogin:获取参数为空", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 0]);
}
//需要授权微信
//if (empty($openid)) {
$appid = \Yaf\Registry::get('config')->wechat->appid;
......@@ -51,6 +54,7 @@ class UserService
if (empty($response) || array_key_exists('errcode', $response)) {
//throw new \Exception('获取openid失败:' . $response['errcode']);
FileLog::error("wechatLogin:获取openid失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 1]);
}
//检查系统是已注册
......@@ -58,7 +62,7 @@ class UserService
//}
$user = UserWechatBind::getRecord(['openid' => $openid]);
$user = UserWechatBind::getRecordMaster(['openid' => $openid]);
//如果系统不存在,用户信息,则注册新用户
if (empty($user) && !empty($response)) {
$insert = [
......@@ -68,8 +72,13 @@ class UserService
'create_time' => date("Y-m-d H:i:s")
];
$newWechatId = UserWechatBind::save($insert);
$sessionKey = !empty($response['session_key']) ? $response['session_key'] : '';
//$newWechatId = UserWechatBind::save($insert);
$newWechatId =UserWechatBind::insertDuplicate($insert, ['session_key' => $sessionKey,'create_time' => date("Y-m-d H:i:s")]);
if (!$newWechatId) {
FileLog::error("wechatLogin:登陆创建用户失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
FileLog::error("wechatLogin:登陆创建用户失败--insert", json_encode($insert, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 2]);
}
......@@ -78,13 +87,17 @@ class UserService
$user['session_key'] = $response['session_key'];
}else{
if (empty($user)) {
FileLog::error("wechatLogin:登陆创建用户失败-- 微信response", json_encode($response, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 2]);
}
if (empty($response)){
FileLog::error("wechatLogin:登陆创建用户失败-- 微信response 获取失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 2]);
}
$insert = [
'session_key' => !empty($response['session_key']) ? $response['session_key'] : '',
];
$newWechatId = UserWechatBind::save($insert,['openid' => $openid]);
}
......@@ -108,17 +121,20 @@ class UserService
$appid = \Yaf\Registry::get('config')->wechat->appid;
if (!$encryptedData) {
FileLog::error("bindPhone:encryptedData 为空", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 3]);
}
if (!$iv) {
FileLog::error("bindPhone:iv 为空", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 4]);
}
$userInfo = UserWechatBind::getRecord(['openid' => $openid]);
$userInfo = UserWechatBind::getRecordMaster(['openid' => $openid]);
$sessionKey = !empty($userInfo['session_key']) ? $userInfo['session_key'] : '';
$openid = isset($userInfo['openid']) && $userInfo['openid'] ? $userInfo['openid'] : '';
if (empty($userInfo) || !$sessionKey || !$openid) {
FileLog::error("bindPhone:userInfo获取失败", json_encode($userInfo, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 5]);
}
......@@ -128,18 +144,23 @@ class UserService
$errCode = $wXBizDataCrypt->decryptData($encryptedData, $iv, $decryptData);
if ($errCode) {
FileLog::error("bindPhone:解密失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 6]);
}
// 手机号解密成功
// 手机号解密失败
if (empty($decryptData['phoneNumber'])) {
FileLog::error("bindPhone:手机号解密失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
FileLog::error("bindPhone:手机号解密失败--decryptData", json_encode($decryptData, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 7]);
}
$phoneNumber = strval($decryptData['phoneNumber']);
//判断是否已
$user = UserWechatBind::getRecord(['phone' => $phoneNumber]);
$user = UserWechatBind::getRecordMaster(['phone' => $phoneNumber]);
if (!empty($user) && $openid != $user['openid']) {
FileLog::error("bindPhone:该手机号已绑定其他用户不能重复绑定", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
FileLog::error("bindPhone:该手机号已绑定其他用户不能重复绑定--user", json_encode($user, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 9]);
}
......@@ -157,7 +178,13 @@ class UserService
];
$bindStatus = UserWechatBind::save($update,['wechat_id' => $userInfo['wechat_id']]);
if (empty($bindStatus)){
FileLog::error("bindPhone:绑定手机号保存失败", json_encode($update, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 12]);
}
if (!$phoneNumber) {
FileLog::error("bindPhone:该手机号已绑定其他用户不能重复绑定--user", json_encode($user, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 8]);
}
......@@ -210,10 +237,17 @@ class UserService
"city" => !empty($params['city']) ? $params['city'] : '',
"language" => !empty($params['language']) ? $params['language'] : '',
];
$bindStatus = UserWechatBind::save($update,['openid' => $params['openid']]);
$user = UserWechatBind::getRecordMaster(['openid' => $params['openid']]);
if (empty($user)){
$update['openid'] = $params['openid'];
$bindStatus = UserWechatBind::save($update);
}else{
$bindStatus = UserWechatBind::save($update,['openid' => $params['openid']]);
}
if (!$bindStatus) {
throw new UserException(['cus' => 8]);
FileLog::error("bindAvatar:绑定头像失败", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
FileLog::error("bindAvatar:绑定头像失败--update", json_encode($update, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
throw new UserException(['cus' => 11]);
}
return $update;
}
......
......@@ -6,7 +6,7 @@
"require": {
"php": "7.2.*",
"ext-json": "*",
"api/php_utils":"1.0.15",
"api/php_utils":"1.0.16",
"api/php_services":"1.0.13",
"ext-openssl": "*"
},
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "a7741f079784d6a5d991f5e205ec4307",
"content-hash": "aba1b9acb9fbb845bfacfcdbe713c044",
"packages": [
{
"name": "api/php_services",
......@@ -30,11 +30,11 @@
},
{
"name": "api/php_utils",
"version": "v1.0.15",
"version": "v1.0.16",
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "feb1de3de8f74171202237e1443f8a395038b8d7"
"reference": "6c294df8b60aa4b30d40bae7f0f0afb3b5703769"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -53,7 +53,7 @@
}
},
"description": "bp api php_utils",
"time": "2021-09-03T08:58:11+00:00"
"time": "2021-09-06T05:39:50+00:00"
},
{
"name": "bacon/bacon-qr-code",
......@@ -483,12 +483,12 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"shasum": ""
},
"require": {
......@@ -517,10 +517,25 @@
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle promises library",
......@@ -529,9 +544,23 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.4.1"
"source": "https://github.com/guzzle/promises/tree/master"
},
"time": "2021-03-07T09:25:29+00:00"
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
"type": "tidelift"
}
],
"time": "2021-09-05T15:38:28+00:00"
},
{
"name": "guzzlehttp/psr7",
......@@ -539,12 +568,12 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f",
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f",
"shasum": ""
},
"require": {
......@@ -581,13 +610,34 @@
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
......@@ -606,7 +656,7 @@
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.x"
},
"time": "2021-04-26T09:17:50+00:00"
"time": "2021-09-05T19:11:18+00:00"
},
{
"name": "khanamiryan/qrcode-detector-decoder",
......
......@@ -31,6 +31,6 @@ exception.sys.msg = "系统未定义异常,研发正在赶来的路上..."
[prod : common : exception]
[pre : common : exception]
[perf : common : exception]
[test : common : exception]
[dev : common : exception]
\ No newline at end of file
......@@ -11,6 +11,10 @@ idgen.partner = "bp"
idgen.key = "5cfdb867e96374c7883b31d6928cc4cb"
[prod : common]
[pre : common ]
[perf : common ]
[test: common ]
[dev : common ]
\ No newline at end of file
colonel.wallet.transfer_service_id="21090614423333205002"
colonel.wallet.transfer_service_secret="4916927cf3305292f5a524db592dfa95"
[dev : common ]
colonel.wallet.transfer_service_id="21090614322322205004"
colonel.wallet.transfer_service_secret="e24126c53d4507381ff800a6653611e4"
\ No newline at end of file
<?php
namespace Api\PhpUtils\Log;
/**
* @method JobLog info($signature, $detail_info = '', $with_access_log = false)
* @method JobLog waring($signature, $detail_info = '', $exception = null)
* @method JobLog error($signature, $detail_info = '', $exception = null, $mail_to = '')
*/
class JobLog
{
protected static $instance = null;
public $log = null;
protected function __construct()
{
}
protected function __clone()
{
}
public static function getInstance(): ?JobLog
{
if (is_null(self::$instance)) {
self::$instance = new static();
}
return self::$instance;
}
public function __call($name, $arguments)
{
$this->setLog($arguments);
if (in_array($name, get_class_methods(FileLog::class))) {
call_user_func_array([FileLog::class, $name], $arguments);
}
return $this;
}
private function setLog($arguments)
{
if (!empty($arguments[0]) && !empty($arguments[1])) {
$this->log = date('Y-m-d H:i:s') . ";$arguments[0]:$arguments[1]" . PHP_EOL;
}
}
public function output()
{
echo $this->log . PHP_EOL;
}
}
......@@ -32,7 +32,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => 'bdf89778ba6a83a43c24ce687bdd41b5057a7532',
'reference' => '75f2b6396d944503b60b70e800f7988b6661461c',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -48,12 +48,12 @@ private static $installed = array (
),
'api/php_utils' =>
array (
'pretty_version' => 'v1.0.15',
'version' => '1.0.15.0',
'pretty_version' => 'v1.0.16',
'version' => '1.0.16.0',
'aliases' =>
array (
),
'reference' => 'feb1de3de8f74171202237e1443f8a395038b8d7',
'reference' => '6c294df8b60aa4b30d40bae7f0f0afb3b5703769',
),
'bacon/bacon-qr-code' =>
array (
......@@ -128,7 +128,7 @@ private static $installed = array (
array (
0 => '1.4.x-dev',
),
'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d',
'reference' => 'c1dd809c8f51a477701052f4b9e5b4bb5c1061aa',
),
'guzzlehttp/psr7' =>
array (
......@@ -137,7 +137,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91',
'reference' => '9d006741ba865a45adccfac45d8e1053086a5a3f',
),
'khanamiryan/qrcode-detector-decoder' =>
array (
......@@ -332,7 +332,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => 'bdf89778ba6a83a43c24ce687bdd41b5057a7532',
'reference' => '75f2b6396d944503b60b70e800f7988b6661461c',
),
),
);
......
......@@ -67,6 +67,7 @@ return array(
'Api\\PhpUtils\\Lock\\FrequencyLockUtil' => $vendorDir . '/api/php_utils/src/Lock/FrequencyLockUtil.php',
'Api\\PhpUtils\\Log\\DaemonLog' => $vendorDir . '/api/php_utils/src/Log/DaemonLog.php',
'Api\\PhpUtils\\Log\\FileLog' => $vendorDir . '/api/php_utils/src/Log/FileLog.php',
'Api\\PhpUtils\\Log\\JobLog' => $vendorDir . '/api/php_utils/src/Log/JobLog.php',
'Api\\PhpUtils\\Log\\Tracer' => $vendorDir . '/api/php_utils/src/Log/Tracer.php',
'Api\\PhpUtils\\Message\\Email' => $vendorDir . '/api/php_utils/src/Message/Email.php',
'Api\\PhpUtils\\Mon\\MonUtil' => $vendorDir . '/api/php_utils/src/Mon/MonUtil.php',
......
......@@ -17,8 +17,8 @@ return array(
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'3a37ebac017bc098e9a86b35401e7a68' => $vendorDir . '/mongodb/mongodb/src/functions.php',
......
......@@ -18,8 +18,8 @@ class ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/autoload.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'3a37ebac017bc098e9a86b35401e7a68' => __DIR__ . '/..' . '/mongodb/mongodb/src/functions.php',
......@@ -296,6 +296,7 @@ class ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
'Api\\PhpUtils\\Lock\\FrequencyLockUtil' => __DIR__ . '/..' . '/api/php_utils/src/Lock/FrequencyLockUtil.php',
'Api\\PhpUtils\\Log\\DaemonLog' => __DIR__ . '/..' . '/api/php_utils/src/Log/DaemonLog.php',
'Api\\PhpUtils\\Log\\FileLog' => __DIR__ . '/..' . '/api/php_utils/src/Log/FileLog.php',
'Api\\PhpUtils\\Log\\JobLog' => __DIR__ . '/..' . '/api/php_utils/src/Log/JobLog.php',
'Api\\PhpUtils\\Log\\Tracer' => __DIR__ . '/..' . '/api/php_utils/src/Log/Tracer.php',
'Api\\PhpUtils\\Message\\Email' => __DIR__ . '/..' . '/api/php_utils/src/Message/Email.php',
'Api\\PhpUtils\\Mon\\MonUtil' => __DIR__ . '/..' . '/api/php_utils/src/Mon/MonUtil.php',
......
......@@ -27,12 +27,12 @@
},
{
"name": "api/php_utils",
"version": "v1.0.15",
"version_normalized": "1.0.15.0",
"version": "v1.0.16",
"version_normalized": "1.0.16.0",
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "feb1de3de8f74171202237e1443f8a395038b8d7"
"reference": "6c294df8b60aa4b30d40bae7f0f0afb3b5703769"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -44,7 +44,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-09-03T08:58:11+00:00",
"time": "2021-09-06T05:39:50+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
......@@ -547,19 +547,13 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"shasum": ""
},
"require": {
"php": ">=5.5"
......@@ -567,7 +561,7 @@
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
},
"time": "2021-03-07T09:25:29+00:00",
"time": "2021-09-05T15:38:28+00:00",
"default-branch": true,
"type": "library",
"extra": {
......@@ -589,10 +583,25 @@
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"description": "Guzzle promises library",
......@@ -601,8 +610,22 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.4.1"
"source": "https://github.com/guzzle/promises/tree/master"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
"type": "tidelift"
}
],
"install-path": "../guzzlehttp/promises"
},
{
......@@ -612,19 +635,13 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f",
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
......@@ -641,7 +658,7 @@
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"time": "2021-04-26T09:17:50+00:00",
"time": "2021-09-05T19:11:18+00:00",
"type": "library",
"extra": {
"branch-alias": {
......@@ -662,13 +679,34 @@
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
......
......@@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => 'bdf89778ba6a83a43c24ce687bdd41b5057a7532',
'reference' => '75f2b6396d944503b60b70e800f7988b6661461c',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -22,12 +22,12 @@
),
'api/php_utils' =>
array (
'pretty_version' => 'v1.0.15',
'version' => '1.0.15.0',
'pretty_version' => 'v1.0.16',
'version' => '1.0.16.0',
'aliases' =>
array (
),
'reference' => 'feb1de3de8f74171202237e1443f8a395038b8d7',
'reference' => '6c294df8b60aa4b30d40bae7f0f0afb3b5703769',
),
'bacon/bacon-qr-code' =>
array (
......@@ -102,7 +102,7 @@
array (
0 => '1.4.x-dev',
),
'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d',
'reference' => 'c1dd809c8f51a477701052f4b9e5b4bb5c1061aa',
),
'guzzlehttp/psr7' =>
array (
......@@ -111,7 +111,7 @@
'aliases' =>
array (
),
'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91',
'reference' => '9d006741ba865a45adccfac45d8e1053086a5a3f',
),
'khanamiryan/qrcode-detector-decoder' =>
array (
......@@ -306,7 +306,7 @@
'aliases' =>
array (
),
'reference' => 'bdf89778ba6a83a43c24ce687bdd41b5057a7532',
'reference' => '75f2b6396d944503b60b70e800f7988b6661461c',
),
),
);
Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
The MIT License (MIT)
Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2017 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2020 Tobias Nyholm <tobias.nyholm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -530,3 +530,18 @@ A static API was first introduced in 1.4.0, in order to mitigate problems with f
| `is_rejected` | `Is::rejected` |
| `is_settled` | `Is::settled` |
| `coroutine` | `Coroutine::of` |
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
......@@ -4,10 +4,25 @@
"keywords": ["promise"],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"require": {
......@@ -35,5 +50,9 @@
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
github: [Nyholm, GrahamCampbell]
tidelift: "packagist/guzzlehttp/psr7"
daysUntilStale: 120
daysUntilClose: 14
exemptLabels:
- lifecycle/keep-open
- lifecycle/ready-for-merge
# Label to use when marking an issue as stale
staleLabel: lifecycle/stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
name: BC Check
on:
pull_request:
jobs:
roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
......@@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 10
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Set up PHP
......@@ -23,8 +23,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Mimic PHP 8.0
run: composer config platform.php 8.0.999
if: matrix.php > 8
- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist
run: composer update --no-interaction --no-progress
- name: Run tests
run: make test
......@@ -26,7 +26,7 @@ jobs:
- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader
composer-options: --no-interaction --optimize-autoloader
- name: Start server
run: php -S 127.0.0.1:10002 tests/Integration/server.php &
......
Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
The MIT License (MIT)
Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com>
Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2016 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2016 George Mponos <gmponos@gmail.com>
Copyright (c) 2018 Tobias Nyholm <tobias.nyholm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -807,3 +807,18 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
equivalence or difference of relative references does not mean anything.
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
{
"name": "guzzlehttp/psr7",
"type": "library",
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
......@@ -45,5 +65,9 @@
"branch-alias": {
"dev-master": "1.7-dev"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment