Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
1b9dd0d7
Commit
1b9dd0d7
authored
Jul 20, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
df46b0bf
58f6a3b5
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
486 additions
and
165 deletions
+486
-165
DistributorException.php
application/exception/custom/DistributorException.php
+1
-0
GoodsException.php
application/exception/custom/GoodsException.php
+1
-0
GoodsSkuSubShop.php
application/models/goods/mysql/GoodsSkuSubShop.php
+8
-0
Goods.php
application/modules/Goods/controllers/Goods.php
+9
-0
Distributor.php
application/modules/Marketing/controllers/Distributor.php
+8
-0
Marketing.php
application/modules/Marketing/controllers/Marketing.php
+7
-0
Marketinggoods.php
application/modules/Marketing/controllers/Marketinggoods.php
+3
-3
ElasticGoodService.php
application/services/goods/ElasticGoodService.php
+7
-6
GoodsService.php
application/services/goods/GoodsService.php
+57
-16
DistributorService.php
application/services/marketing/DistributorService.php
+56
-7
MarketingGoodsService.php
application/services/marketing/MarketingGoodsService.php
+17
-11
MarketingService.php
application/services/marketing/MarketingService.php
+14
-6
Goods.php
daemon/Goods.php
+2
-1
Marketing.php
daemon/Marketing.php
+3
-2
IdCertification.php
...or/api/php_services/src/Certification/IdCertification.php
+5
-3
SocialCreditCertification.php
..._services/src/Certification/SocialCreditCertification.php
+1
-1
ThreeElementsCertification.php
...services/src/Certification/ThreeElementsCertification.php
+1
-1
Daemon.php
vendor/api/php_services/src/Daemon/Daemon.php
+3
-1
JwUser.php
vendor/api/php_services/src/JwUser/JwUser.php
+11
-1
Ks3Api.php
vendor/api/php_services/src/Ksy/Ks3Api.php
+5
-6
Ksyun.php
vendor/api/php_services/src/Ksy/Ksyun.php
+10
-1
GetImage.php
vendor/api/php_services/src/ShopImage/GetImage.php
+38
-1
HttpUtil.php
vendor/api/php_utils/src/Http/HttpUtil.php
+150
-48
FrequencyLockUtil.php
vendor/api/php_utils/src/Lock/FrequencyLockUtil.php
+2
-2
MysqlBase.php
vendor/api/php_utils/src/Mysql/MysqlBase.php
+20
-0
InstalledVersions.php
vendor/composer/InstalledVersions.php
+9
-10
autoload_classmap.php
vendor/composer/autoload_classmap.php
+1
-0
autoload_static.php
vendor/composer/autoload_static.php
+1
-0
installed.json
vendor/composer/installed.json
+19
-20
installed.php
vendor/composer/installed.php
+9
-10
README.md
vendor/symfony/polyfill-php80/README.md
+1
-1
PropertyAccessor.php
vendor/symfony/property-access/PropertyAccessor.php
+1
-1
PhpDocExtractor.php
vendor/symfony/property-info/Extractor/PhpDocExtractor.php
+3
-3
ReflectionExtractor.php
...r/symfony/property-info/Extractor/ReflectionExtractor.php
+3
-3
No files found.
application/exception/custom/DistributorException.php
View file @
1b9dd0d7
...
...
@@ -33,5 +33,6 @@ class DistributorException extends BaseException
14
=>
'用户id不能能为空'
,
15
=>
'活动id不能能为空'
,
16
=>
'商品id不能能为空'
,
17
=>
'验证码不正确或过期'
,
];
}
\ No newline at end of file
application/exception/custom/GoodsException.php
View file @
1b9dd0d7
...
...
@@ -41,5 +41,6 @@ class GoodsException extends BaseException
27
=>
'TCC调用失败'
,
28
=>
'上架状态不能编辑,需先下架,再做编辑操作'
,
29
=>
'发布商品的生活号不存在'
,
30
=>
'当前商品已过期'
,
];
}
\ No newline at end of file
application/models/goods/mysql/GoodsSkuSubShop.php
View file @
1b9dd0d7
...
...
@@ -31,6 +31,14 @@ class GoodsSkuSubShop extends MysqlBase
return
self
::
selectMaster
(
$colums
,
$where
);
}
public
static
function
getRecords
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
select
(
$colums
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[])
{
if
(
empty
(
$where
))
{
...
...
application/modules/Goods/controllers/Goods.php
View file @
1b9dd0d7
...
...
@@ -231,6 +231,15 @@ class GoodsController extends Base
$this
->
success
([
"result"
=>
$data
]);
}
public
function
goods_spu_shop_listAction
()
{
$params
=
$this
->
params
;
$data
=
GoodsService
::
getGoodsSkuSubShopList
(
$params
);
$this
->
success
([
"result"
=>
$data
]);
}
/**
...
...
application/modules/Marketing/controllers/Distributor.php
View file @
1b9dd0d7
...
...
@@ -9,6 +9,14 @@ use \Validate\CheckIsDistributorValidate;
class
DistributorController
extends
Base
{
public
function
get_distributorAction
()
{
$params
=
$this
->
params
;
$distributionList
=
DistributorService
::
getDistributorList
(
$params
);
$this
->
success
([
'result'
=>
$distributionList
]);
}
public
function
importAction
()
{
$distributionList
=
DistributorService
::
import
();
...
...
application/modules/Marketing/controllers/Marketing.php
View file @
1b9dd0d7
...
...
@@ -9,6 +9,13 @@ use \Validate\MarketingGoodsRateValidate;
class
MarketingController
extends
Base
{
public
function
get_marketing_listAction
()
{
$params
=
$this
->
params
;
$list
=
MarketingService
::
getMarketingList
(
$params
);
$distributionList
[
'result'
]
=
$list
;
$this
->
success
(
$distributionList
);
}
/**
* 营销列表
* 后台管理
...
...
application/modules/Marketing/controllers/Marketinggoods.php
View file @
1b9dd0d7
...
...
@@ -61,8 +61,8 @@ class MarketinggoodsController extends Base
$goodsSkuInfo
=
GoodsSku
::
getRecord
([
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsName
=
!
empty
(
$goodsSkuInfo
[
'goods_name'
])
?
$goodsSkuInfo
[
'goods_name'
]
:
''
;
$oldPrice
=
!
empty
(
$goodsSkuInfo
[
'original_price'
])
?
$goodsSkuInfo
[
'original_price'
]
:
'
'
;
$price
=
!
empty
(
$goodsSkuInfo
[
'price'
])
?
$goodsSkuInfo
[
'price'
]
:
"0.00"
;
$oldPrice
=
!
empty
(
$goodsSkuInfo
[
'original_price'
])
?
$goodsSkuInfo
[
'original_price'
]
/
100
:
'0.00
'
;
$price
=
!
empty
(
$goodsSkuInfo
[
'price'
])
?
$goodsSkuInfo
[
'price'
]
/
100
:
"0.00"
;
$goodsImg
=
""
;
...
...
@@ -92,11 +92,11 @@ class MarketinggoodsController extends Base
'nick_name'
=>
$nickName
,
'avatar'
=>
$avatar
,
];
$getImage
=
new
GetImage
();
$buyCount
=
1
;
$getImage
->
getGoods
(
$avatar
,
$goodsImg
,
$nickName
,
$goodsName
,
$goods_share_url
,
$price
,
$oldPrice
,
$buyCount
);
//$result = ['result' => $data];
//$this->success($result);
}
...
...
application/services/goods/ElasticGoodService.php
View file @
1b9dd0d7
...
...
@@ -132,7 +132,6 @@ class ElasticGoodService
$result
[
"count"
]
=
$res
[
"hits"
][
"total"
][
"value"
];
foreach
(
$res
[
"hits"
][
"hits"
]
as
$key
=>
$source
)
{
$result
[
"list"
][
$key
][
"goods_desc_pic_url_list"
]
=
[];
if
(
!
empty
(
$source
[
"_source"
][
"goods_desc_pic_url"
]))
{
$ksyun
=
GoodsService
::
getUrlList
(
$source
[
"_source"
][
"goods_desc_pic_url"
],
200
,
200
);
...
...
@@ -154,7 +153,7 @@ class ElasticGoodService
$result
[
"list"
][
$key
][
"life_account_id"
]
=
$source
[
"_source"
][
"life_account_id"
];
$result
[
"list"
][
$key
][
"life_account_name"
]
=
$source
[
"_source"
][
"life_account_name"
];
$result
[
"list"
][
$key
][
"life_account_icon"
]
=
$source
[
"_source"
][
"life_account_icon"
];
$result
[
"list"
][
$key
][
"distance"
]
=
empty
(
$source
[
"sort"
][
1
])
?
""
:
round
(
$source
[
"sort"
][
1
],
2
)
.
"km"
;
$result
[
"list"
][
$key
][
"distance"
]
=
empty
(
$source
[
"sort"
][
0
])
?
""
:
round
(
$source
[
"sort"
][
0
],
2
)
.
"km"
;
$result
[
"list"
][
$key
][
"update_time"
]
=
$source
[
"_source"
][
"update_time"
];
}
}
...
...
@@ -187,7 +186,7 @@ class ElasticGoodService
[
"price_sort"
=>
"asc"
],
];
$sortInit
=
empty
(
$sortList
[
$sortType
-
1
])
?
$sortList
[
0
]
:
$sortList
[
$sortType
-
1
];
$sortInit
=
isset
(
$sortList
[
$sortType
])
?
$sortList
[
$sortType
]
:
$sortList
[
0
];
$sort
=
array_merge
(
$sortInit
,
$subjectSort
);
$data
=
[
"sort"
=>
$sort
,
...
...
@@ -201,7 +200,7 @@ class ElasticGoodService
],
"order"
=>
"asc"
,
"unit"
=>
"km"
,
"distance_type"
=>
"plane"
,
"distance_type"
=>
"plane"
,
//更快但精度稍差的 plane 计算方法
];
}
return
$data
;
...
...
@@ -232,6 +231,9 @@ class ElasticGoodService
[
"term"
=>
[
"audit_status"
=>
GoodsSku
::
STATUS_PASS
]],
[
"term"
=>
[
"online_status"
=>
GoodsSku
::
ONLINE_STATUS_ONLINE
]],
];
//gte 是大于等于; gt是大于; lte是小于等于; lt是小于
$data
[
"query"
][
"bool"
][
"filter"
][][
"range"
]
=
[
"inventory_rest"
=>
[[
"gt"
=>
0
]]];
if
(
!
empty
(
$searchContent
)
||
(
!
empty
(
$subjectName
)
&&
$subjectName
!=
"本周上新"
))
{
$multiMatch
=
[[
"multi_match"
=>
[
"query"
=>
$searchContent
.
$subjectName
,
...
...
@@ -249,7 +251,7 @@ class ElasticGoodService
}
if
(
!
empty
(
$latitude
)
&&
!
empty
(
$longitude
))
{
$data
[
"query"
][
"bool"
][
"filter"
][
"geo_distance"
]
=
[
$data
[
"query"
][
"bool"
][
"filter"
][
][
"geo_distance"
]
=
[
"distance"
=>
"50km"
,
"shop_location"
=>
[
"lat"
=>
$latitude
,
...
...
@@ -257,7 +259,6 @@ class ElasticGoodService
]
];
}
return
$data
;
}
...
...
application/services/goods/GoodsService.php
View file @
1b9dd0d7
...
...
@@ -355,6 +355,12 @@ class GoodsService
if
(
$sku
[
"audit_status"
]
==
GoodsSku
::
STATUS_PASS
||
$sku
[
"audit_status"
]
==
GoodsSku
::
STATUS_REJECT
)
{
throw
new
GoodsException
([
"cus"
=>
10
]);
}
if
(
$status
==
GoodsSku
::
STATUS_PASS
&&
$sku
[
"expiration_time"
]
<
date
(
"Y-m-d H:i:s"
))
{
throw
new
GoodsException
([
"cus"
=>
30
]);
}
if
(
$status
==
GoodsSku
::
STATUS_PASS
&&
$sku
[
"inventory_rest"
]
<=
0
)
{
throw
new
GoodsException
([
"cus"
=>
24
]);
}
$goodsSkuId
=
$sku
[
"goods_sku_id"
];
$rejectedReason
=
strlen
(
trim
(
$params
[
"rejected_reason"
]))
==
0
?
""
:
$params
[
"rejected_reason"
];
...
...
@@ -437,6 +443,12 @@ class GoodsService
if
(
$sku
[
"audit_status"
]
!=
GoodsSku
::
STATUS_PASS
)
{
throw
new
GoodsException
([
"cus"
=>
14
]);
}
if
(
$onlineStatus
==
GoodsSku
::
ONLINE_STATUS_ONLINE
&&
$sku
[
"expiration_time"
]
<
date
(
"Y-m-d H:i:s"
))
{
throw
new
GoodsException
([
"cus"
=>
30
]);
}
if
(
$onlineStatus
==
GoodsSku
::
ONLINE_STATUS_ONLINE
&&
$sku
[
"inventory_rest"
]
<=
0
)
{
throw
new
GoodsException
([
"cus"
=>
24
]);
}
$goodsSkuId
=
$sku
[
"goods_sku_id"
];
GoodsSku
::
save
([
"online_status"
=>
$onlineStatus
],
[
"goods_sku_id"
=>
$goodsSkuId
]);
...
...
@@ -580,6 +592,7 @@ class GoodsService
throw
new
GoodsException
([
'cus'
=>
16
]);
}
$inventoryCount
=
$skuData
[
"inventory_rest"
]
+
$params
[
"inventory_add"
];
//$inventoryCount = $params["inventory"];
if
(
$inventoryCount
<
0
)
{
throw
new
GoodsException
([
'cus'
=>
18
]);
}
...
...
@@ -625,6 +638,7 @@ class GoodsService
"rule_start_time"
=>
empty
(
$params
[
"rule_start_time"
])
?
""
:
$params
[
"rule_start_time"
],
"rule_end_time"
=>
empty
(
$params
[
"rule_end_time"
])
?
""
:
$params
[
"rule_end_time"
],
"inventory_total"
=>
$skuData
[
"inventory_total"
]
+
$params
[
"inventory_add"
],
//"inventory_total" => $params["inventory"],
"inventory_rest"
=>
$inventoryCount
,
"original_price"
=>
$params
[
"original_price"
]
*
100
,
"price"
=>
$params
[
"price"
]
*
100
,
...
...
@@ -733,7 +747,8 @@ class GoodsService
$data
[
"goods_info"
][
"original_price"
]
=
$sku
[
"original_price"
]
/
100
;
$data
[
"goods_info"
][
"price"
]
=
$sku
[
"price"
]
/
100
;
$data
[
"goods_info"
][
"inventory"
]
=
$sku
[
"inventory_rest"
];
$categoryNameList
=
Category
::
select
(
"name"
,
[
"category_id"
=>
[
$sku
[
"category_1_id"
],
$sku
[
"category_2_id"
]]]);
$data
[
"goods_info"
][
"category_1_name"
]
=
$categoryNameList
[
0
];
$data
[
"goods_info"
][
"category_2_name"
]
=
$categoryNameList
[
1
];
...
...
@@ -765,12 +780,14 @@ class GoodsService
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
true
;
if
(
!
empty
(
$runningMarketing
))
{
//分销返现多少钱
$data
[
"goods_info"
][
"cash_back"
]
=
$runningMarketing
[
$sku
[
"goods_sku_id"
]]
*
$data
[
"goods_info"
][
"price"
]
;
$data
[
"goods_info"
][
"cash_back"
]
=
sprintf
(
"%.2f"
,
$runningMarketing
[
$sku
[
"goods_sku_id"
]]
*
$data
[
"goods_info"
][
"price"
])
;
}
}
}
}
}
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
,
"ORDER"
=>
[
"create_time"
=>
"DESC"
]]);
if
(
!
empty
(
$recordList
))
{
foreach
(
$recordList
as
$key
=>
$record
)
{
...
...
@@ -867,7 +884,7 @@ class GoodsService
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
true
;
if
(
!
empty
(
$runningMarketing
))
{
//分销返现多少钱
$data
[
"goods_info"
][
"cash_back"
]
=
$runningMarketing
[
$params
[
"goods_sku_id"
]]
*
$data
[
"goods_info"
][
"price"
]
;
$data
[
"goods_info"
][
"cash_back"
]
=
sprintf
(
"%.2f"
,
$runningMarketing
[
$params
[
"goods_sku_id"
]]
*
$data
[
"goods_info"
][
"price"
])
;
}
}
}
...
...
@@ -1310,6 +1327,32 @@ class GoodsService
return
$list
;
}
/**
* 获取 GoodsSku 列表
* @param $params
* @return array
* @throws GoodsException
*/
public
static
function
getGoodsSkuSubShopList
(
$params
)
{
$where
=
[];
if
(
empty
(
$params
))
{
return
[];
}
if
(
!
empty
(
$params
[
'goods_sku_id'
]))
{
$where
[
'goods_sku_id'
]
=
$params
[
'goods_sku_id'
];
}
if
(
!
empty
(
$params
[
'sub_shop_id'
]))
{
$where
[
'sub_shop_id'
]
=
$params
[
'sub_shop_id'
];
}
$list
=
GoodsSkuSubShop
::
getRecords
(
$where
);
return
$list
;
}
/**
* 获取图片地址,这里因为bucket可能不同,不保证图片顺序
* @param $picUrlStr
...
...
@@ -1323,20 +1366,18 @@ class GoodsService
$strList
=
explode
(
","
,
$picUrlStr
);
foreach
(
$strList
as
$key
=>
$str
)
{
$arr
=
explode
(
"/"
,
$str
);
if
(
count
(
$arr
)
==
1
)
{
if
(
preg_match
(
"/^http[s]
{
0,1
}
:\/\/([\w.]+\/?)\S*/"
,
$str
))
{
$data
[]
=
$str
;
if
(
preg_match
(
"/^http[s]
{
0,1
}
:\/\/([\w.]+\/?)\S*/"
,
$str
))
{
$data
[]
=
$str
;
}
else
if
(
count
(
$arr
)
==
1
)
{
if
(
!
empty
(
$widthSize
)
&&
!
empty
(
$highSize
))
{
$urlRes
=
Ks3Api
::
picEncryptUrl
(
$str
,
$widthSize
,
$highSize
);
}
else
{
if
(
!
empty
(
$widthSize
)
&&
!
empty
(
$highSize
))
{
$urlRes
=
Ks3Api
::
picEncryptUrl
(
$str
,
$widthSize
,
$highSize
);
}
else
{
$urlRes
=
Ks3Api
::
picEncryptUrl
(
$str
);
}
if
(
$urlRes
[
"response"
][
"data"
][
"url"
])
{
$data
[]
=
$urlRes
[
"response"
][
"data"
][
"url"
];
}
else
{
continue
;
}
$urlRes
=
Ks3Api
::
picEncryptUrl
(
$str
);
}
if
(
!
empty
(
$urlRes
[
"response"
][
"data"
][
"url"
])
&&
$urlRes
[
"response"
][
"data"
][
"url"
])
{
$data
[]
=
$urlRes
[
"response"
][
"data"
][
"url"
];
}
else
{
continue
;
}
}
else
{
$bucket
=
$arr
[
0
];
...
...
application/services/marketing/DistributorService.php
View file @
1b9dd0d7
...
...
@@ -17,6 +17,8 @@ use Api\PhpServices\ShopImage\GetImage;
use
Api\PhpServices\ShopImage\QR
;
use
App\Exception\custom\InterfaceException
;
use
App\Services\goods\GoodsService
;
use
Api\PhpUtils\Http\Request
;
use
App\Exception\BaseException
;
class
DistributorService
{
...
...
@@ -71,7 +73,7 @@ class DistributorService
$countWhere
=
[
'parent_user_id'
=>
!
empty
(
$params
[
'user_id'
])
?
$params
[
'user_id'
]
:
''
,
"create_time[
><
]"
=>
[
date
(
"Y-m-d 00:00:00"
),
date
(
"Y-m-d 23:59:59"
)]
"create_time[
<>
]"
=>
[
date
(
"Y-m-d 00:00:00"
),
date
(
"Y-m-d 23:59:59"
)]
];
$todayNum
=
Distributor
::
getCount
(
$countWhere
,
"*"
);
...
...
@@ -181,6 +183,10 @@ class DistributorService
if
(
empty
(
$smsCode
))
{
throw
new
DistributorException
([
'cus'
=>
11
]);
}
$sms
=
self
::
checkSmsCode
(
$params
);
if
(
$sms
[
'code'
]
!=
0
)
{
throw
new
BaseException
([
'code'
=>
$sms
[
'code'
],
'msg'
=>
$sms
[
'reason'
]]);
}
$jwUserId
=
''
;
// if (empty($distributorCode)) {
...
...
@@ -292,6 +298,39 @@ class DistributorService
}
}
/**
* 发送短信验证码
*
*/
public
static
function
checkSmsCode
(
$params
)
{
$url
=
config
(
'interface'
,
'service.user.check_sms_code'
);
if
(
!
$url
){
throw
new
CodeSpecialException
(
"failed"
);
}
$params
=
[
'mobile'
=>
!
empty
(
$params
[
'mobile'
])
?
$params
[
'mobile'
]
:
''
,
'appid'
=>
!
empty
(
$params
[
'appid'
])
?
$params
[
'appid'
]
:
'hubble'
,
'code'
=>
!
empty
(
$params
[
'sms_code'
])
?
$params
[
'sms_code'
]
:
''
,
'key'
=>
'f16bdd46292480b4b82c841d90a6ba02'
,
'partner'
=>
!
empty
(
$params
[
'appid'
])
?
$params
[
'appid'
]
:
'hubble'
,
"scene"
=>
"distributor"
];
$sms
=
(
new
Request
())
->
get
(
$url
,
$params
);
if
(
!
$sms
){
throw
new
CodeSpecialException
(
"timeout"
);
}
if
(
!
empty
(
$sms
)
&&
$sms
[
'code'
]
==
0
)
{
return
$sms
[
'response'
];
}
else
{
return
$sms
;
}
}
/**
* 发送短信验证码
*
...
...
@@ -309,10 +348,10 @@ class DistributorService
$params
=
[
'mobile'
=>
!
empty
(
$params
[
'mobile'
])
?
$params
[
'mobile'
]
:
''
,
'appid'
=>
'hubble'
,
'appid'
=>
!
empty
(
$params
[
'appid'
])
?
$params
[
'appid'
]
:
'hubble'
,
'code'
=>
'123456'
,
'key'
=>
'f16bdd46292480b4b82c841d90a6ba02'
,
'partner'
=>
'merchant-b
'
,
'partner'
=>
!
empty
(
$params
[
'appid'
])
?
$params
[
'appid'
]
:
'hubble
'
,
'template'
=>
7
,
'code_lenght'
=>
6
,
'ticket_expire'
=>
86400
,
...
...
@@ -320,7 +359,7 @@ class DistributorService
'retry_times'
=>
100
];
$sms
=
(
new
TimeOut
())
->
runG
et
(
$url
,
$params
);
$sms
=
(
new
Request
())
->
g
et
(
$url
,
$params
);
if
(
!
$sms
){
throw
new
CodeSpecialException
(
"timeout"
);
}
...
...
@@ -333,7 +372,7 @@ class DistributorService
}
/**
*
获取二维码
*
是否是团长
*
*/
public
static
function
distributor
(
$params
)
...
...
@@ -350,8 +389,7 @@ class DistributorService
$data
=
[];
$info
=
Distributor
::
getRecord
(
$where
);
$data
=
$info
;
$param
=
[
'user_id'
=>
!
empty
(
$where
[
'user_id'
])
?
$where
[
'user_id'
]
:
''
,
];
...
...
@@ -429,6 +467,17 @@ class DistributorService
return
$info
;
}
public
static
function
getDistributorList
(
$params
)
{
$where
[
'user_id'
]
=
!
empty
(
$params
[
'user_id'
])
?
$params
[
'user_id'
]
:
''
;
$info
=
Distributor
::
getRecords
(
$where
);
return
$info
;
}
/**
* 更新数据
*
...
...
application/services/marketing/MarketingGoodsService.php
View file @
1b9dd0d7
...
...
@@ -14,6 +14,7 @@ use App\Exception\custom\MarketingException;
use
App\Services\common\CommonService
;
use
Api\PhpServices\Sensitive\Sensitive
;
use
App\Services\goods\GoodsService
;
use
Helpers\Aes
;
class
MarketingGoodsService
{
public
static
function
getMarketingGoodsList
(
$params
)
...
...
@@ -38,8 +39,8 @@ class MarketingGoodsService
$list
[
$key
]
=
$value
;
$list
[
$key
][
'marketing_name'
]
=
!
empty
(
$marketing
[
'marketing_name'
])
?
$marketing
[
'marketing_name'
]
:
''
;
$list
[
$key
][
'commission_mode'
]
=
!
empty
(
$marketing
[
'commission_mode'
])
?
$marketing
[
'commission_mode'
]
:
''
;
$list
[
$key
][
'first_commission_value'
]
=
!
empty
(
$marketing
[
'first_commission_value'
])
?
$marketing
[
'first_commission_value'
]
:
''
;
$list
[
$key
][
'second_commission_value'
]
=
!
empty
(
$marketing
[
'second_commission_value'
])
?
$marketing
[
'second_commission_value'
]
:
''
;
$list
[
$key
][
'first_commission_value'
]
=
!
empty
(
$marketing
[
'first_commission_value'
])
?
$marketing
[
'first_commission_value'
]
/
100
:
''
;
$list
[
$key
][
'second_commission_value'
]
=
!
empty
(
$marketing
[
'second_commission_value'
])
?
$marketing
[
'second_commission_value'
]
/
100
:
''
;
$list
[
$key
][
'create_user_email'
]
=
!
empty
(
$marketing
[
'create_user_email'
])
?
$marketing
[
'create_user_email'
]
:
''
;
$list
[
$key
][
'good_count'
]
=
!
empty
(
$marketing
[
'good_count'
])
?
$marketing
[
'good_count'
]
:
''
;
$list
[
$key
][
'start_time'
]
=
!
empty
(
$marketing
[
'start_time'
])
?
$marketing
[
'start_time'
]
:
''
;
...
...
@@ -119,28 +120,33 @@ class MarketingGoodsService
$list
[
$i
][
'goods_name'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'goods_name'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'goods_name'
]
:
''
;
$list
[
$i
][
'goods_desc'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'desc'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'desc'
]
:
''
;
$list
[
$i
][
'goods_spu_id'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'goods_spu_id'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'goods_spu_id'
]
:
''
;
$list
[
$i
][
'original_price'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'original_price'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'original_price'
]
:
''
;
$list
[
$i
][
'price'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'price'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'price'
]
:
''
;
$list
[
$i
][
'original_price'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'original_price'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'original_price'
]
/
100
:
''
;
$list
[
$i
][
'price'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'price'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'price'
]
/
100
:
''
;
$list
[
$i
][
'total_amount_order'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'total_amount_order'
])
?
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'total_amount_order'
]
:
''
;
$list
[
$i
][
'desc_pic_url'
]
=
!
empty
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'desc_pic_url'
])
?
GoodsService
::
getUrlList
(
$goodsSkuList
[
$value
[
'goods_sku_id'
]][
'desc_pic_url'
])
:
''
;
$shopId
=
!
empty
(
$list
[
$i
][
'shop_id'
])
?
$list
[
$i
][
'shop_id'
]
:
''
;
$list
[
$i
][
'shop_name'
]
=
!
empty
(
$subShopList
[
$shopId
][
'shop_name'
])
?
$subShopList
[
$shopId
][
'shop_name'
]
:
''
;
$commissionMode
=
!
empty
(
$marketingList
[
$value
[
'marketing_id'
]][
'commission_mode'
])
?
$marketingList
[
$value
[
'marketing_id'
]][
'commission_mode'
]
:
''
;
$firstCommission
=
!
empty
(
$marketingList
[
$value
[
'marketing_id'
]][
'first_commission_value'
])
?
$marketingList
[
$value
[
'marketing_id'
]][
'first_commission_value'
]
:
0
;
$secondCommission
=
!
empty
(
$marketingList
[
$value
[
'marketing_id'
]][
'second_commission_value'
])
?
$marketingList
[
$value
[
'marketing_id'
]][
'second_commission_value'
]
/
100
:
0
;
//
$list
[
$i
][
'share_price'
]
=
0
;
//比例
if
(
!
empty
(
$
commissionMode
)
&&
$commissionMode
==
1
)
{
if
(
!
empty
(
$
secondCommission
)
&&
$commissionMode
==
1
)
{
$price
=
!
empty
(
$list
[
$i
][
'price'
])
?
$list
[
$i
][
'price'
]
:
0
;
$list
[
$i
][
'share_price'
]
=
$firstCommission
*
$price
/
100
;
$list
[
$i
][
'share_price'
]
=
sprintf
(
"%.2f"
,
$secondCommission
*
$price
/
100
)
;
}
//固定
if
(
!
empty
(
$commissionMode
)
&&
$commissionMode
==
2
)
{
$list
[
$i
][
'share_price'
]
=
$firstCommission
;
$list
[
$i
][
'share_price'
]
=
sprintf
(
"%.2f"
,
$secondCommission
/
100
)
;
}
$content
=
$userId
.
'_'
.
$value
[
'marketing_id'
];
$goodsShareId
=
Aes
::
encrypt
(
$content
);
$list
[
$i
][
'goods_share_code'
]
=
$goodsShareId
;
$i
++
;
}
...
...
@@ -173,7 +179,7 @@ class MarketingGoodsService
$data
=
[];
foreach
(
$marketingInfoIds
as
$goodsSkuId
=>
$marketingId
)
{
if
(
!
empty
(
$marketingList
[
$marketingId
][
"second_commission_value"
]))
{
$data
[
$goodsSkuId
]
=
$marketingList
[
$marketingId
][
"second_commission_value"
]
/
100
;
$data
[
$goodsSkuId
]
=
$marketingList
[
$marketingId
][
"second_commission_value"
]
/
100
00
;
}
}
return
$data
;
...
...
application/services/marketing/MarketingService.php
View file @
1b9dd0d7
...
...
@@ -202,13 +202,13 @@ class MarketingService
throw
new
MarketingException
([
'cus'
=>
0
]);
}
if
(
empty
(
$firstCommissionRate
))
{
throw
new
MarketingException
([
'cus'
=>
3
]);
}
// if (empty($secondCommissionRate)) {
// throw new MarketingException(['cus'=>4]);
// if (empty($firstCommissionRate)) {
// throw new MarketingException(['cus'=>3]);
// }
if
(
empty
(
$secondCommissionRate
))
{
throw
new
MarketingException
([
'cus'
=>
4
]);
}
if
(
self
::
utf8Strlen
(
$marketingName
)
>
50
)
{
throw
new
MarketingException
([
'cus'
=>
1
]);
...
...
@@ -378,6 +378,14 @@ class MarketingService
return
$info
;
}
public
static
function
getMarketingList
(
$params
)
{
$where
[
'marketing_id'
]
=
!
empty
(
$params
[
'marketing_id'
])
?
$params
[
'marketing_id'
]
:
''
;
$marketing_list
=
Marketing
::
getMarketingList
(
$where
);
return
$marketing_list
;
}
...
...
daemon/Goods.php
View file @
1b9dd0d7
...
...
@@ -14,7 +14,8 @@ class Goods implements DaemonServiceInterface
sleep
(
2
);
$orderData
=
[
'online_status'
=>
1
,
'expiration_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
())
'expiration_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'LIMIT'
=>
100
,
];
$goodsList
=
GoodsSku
::
getRecords
(
$orderData
);
DaemonLog
::
info
(
'DaemonServiceInterface_goods'
,
json_encode
(
$goodsList
));
...
...
daemon/Marketing.php
View file @
1b9dd0d7
...
...
@@ -15,7 +15,8 @@ class Marketing implements DaemonServiceInterface
sleep
(
2
);
$orderData
=
[
'online_status'
=>
1
,
'end_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
())
'end_time[<]'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'LIMIT'
=>
100
,
];
$orderInfoList
=
MarketingDao
::
getMarketingList
(
$orderData
);
DaemonLog
::
info
(
'DaemonServiceInterface_marketing'
,
json_encode
(
$orderInfoList
));
...
...
@@ -25,7 +26,7 @@ class Marketing implements DaemonServiceInterface
$colums
=
[
'online_status'
=>
3
,
];
MarketingDao
::
updateRecord
(
$colums
,
$where
);
MarketingDao
::
updateRecord
(
$colums
,
$where
);
}
}
...
...
vendor/api/php_services/src/Certification/IdCertification.php
View file @
1b9dd0d7
...
...
@@ -8,9 +8,9 @@ class IdCertification
{
private
const
key
=
'_v7QkFPgzb887YD6BuBqzHPJMJalJ6Zt'
;
private
const
secret
=
'mDenoicZs2U_wd2jVmQQpCOPeM8jaFRu'
;
p
rivate
const
kuangshi_ocr_url
=
'https://api.megvii.com/faceid/v3/ocridcard'
;
p
rivate
const
kuangshi_get_token
=
'https://api.megvii.com/faceid/v3/sdk/get_biz_token'
;
p
rivate
const
kuangshi_face_compare
=
'https://api.megvii.com/faceid/v3/sdk/verify'
;
p
ublic
const
kuangshi_ocr_url
=
'https://api.megvii.com/faceid/v3/ocridcard'
;
p
ublic
const
kuangshi_get_token
=
'https://api.megvii.com/faceid/v3/sdk/get_biz_token'
;
p
ublic
const
kuangshi_face_compare
=
'https://api.megvii.com/faceid/v3/sdk/verify'
;
/**
* 身份证合法校验
...
...
@@ -232,6 +232,7 @@ class IdCertification
$final_data
[
'birth_year'
]
=
$ocr_data
[
'response'
][
'birth_year'
][
'result'
]
??
''
;
$final_data
[
'completeness'
]
=
$ocr_data
[
'response'
][
'completeness'
]
??
-
1
;
$final_data
[
'legality'
]
=
$ocr_data
[
'response'
][
'legality'
]
??
(
object
)[];
$final_data
[
'code'
]
=
$ocr_data
[
'response'
][
'code'
]
??
-
1
;
return
$final_data
;
}
...
...
@@ -247,6 +248,7 @@ class IdCertification
$final_data
[
'valid_date_end'
]
=
$ocr_data
[
'response'
][
'valid_date_end'
][
'result'
]
??
''
;
$final_data
[
'completeness'
]
=
$ocr_data
[
'response'
][
'completeness'
]
??
-
1
;
$final_data
[
'legality'
]
=
$ocr_data
[
'response'
][
'legality'
]
??
(
object
)[];
$final_data
[
'code'
]
=
$ocr_data
[
'response'
][
'code'
]
??
-
1
;
return
$final_data
;
}
}
\ No newline at end of file
vendor/api/php_services/src/Certification/SocialCreditCertification.php
View file @
1b9dd0d7
...
...
@@ -7,7 +7,7 @@ class SocialCreditCertification
{
private
const
account
=
'BJyimingzhineng'
;
private
const
app_key
=
'deee9c9877e5452f8838cfc5130ac5ad'
;
p
rivate
const
ocr_bussiness_url
=
'http://apistore.xmturui.com/apistore/ocr-new'
;
p
ublic
const
ocr_bussiness_url
=
'http://apistore.xmturui.com/apistore/ocr-new'
;
private
const
engine_type
=
'blic-new'
;
/**
...
...
vendor/api/php_services/src/Certification/ThreeElementsCertification.php
View file @
1b9dd0d7
...
...
@@ -8,7 +8,7 @@ class ThreeElementsCertification
{
private
const
app_key
=
'392df35aa98721c597cf20b85d21eebc'
;
//运营商三要素检测接口
p
rivate
const
test_mobile3_ele_Sim_url
=
'https://api.goodsdatas.com:8443/credit/Mobile3EleSim'
;
p
ublic
const
test_mobile3_ele_Sim_url
=
'https://api.goodsdatas.com:8443/credit/Mobile3EleSim'
;
//加密需要的相关参数
private
const
salt
=
'A99BC8325635E303'
;
...
...
vendor/api/php_services/src/Daemon/Daemon.php
View file @
1b9dd0d7
...
...
@@ -263,11 +263,12 @@ class Daemon
*/
protected
function
set_base_config
(){
ini_set
(
"display_errors"
,
1
);
error_reporting
(
'E_ALL'
);
ini_set
(
'date.timezone'
,
'Asia/Shanghai'
);
ini_set
(
"memory_limit"
,
'2048M'
);
error_reporting
(
E_ALL
);
//日志存储到 php-error.log
/*
//创建任务日志文件
$log_dir = ROOT_PATH.'/logs/daemon/'.$this->task_name;
$log_path = $log_dir.'/'.$this->task_name.'.log';
...
...
@@ -280,6 +281,7 @@ class Daemon
die($log_path."文件无法创建"."\n");
}
}
*/
$this
->
log_signature
=
"daemon:"
.
$this
->
task_name
;
}
...
...
vendor/api/php_services/src/JwUser/JwUser.php
View file @
1b9dd0d7
...
...
@@ -14,6 +14,7 @@ use Api\PhpUtils\Common\TimeOut;
use
Api\PhpUtils\Http\Request
;
use
App\Exception\custom\CodeSpecialException
;
use
Api\PhpUtils\Log\FileLog
;
use
Api\PhpUtils\Mon\MonUtil
;
class
JwUser
{
...
...
@@ -61,7 +62,16 @@ class JwUser
$params
=
[
"userId"
=>
$params
[
'user_id'
]];
//$user_info = (new TimeOut())->runPost($url, $params);
$user_info
=
(
new
Request
())
->
post
(
$url
,
$params
,
0
,
''
,
''
,
0
,
true
,
'jw_user'
);
$begin
=
microtime
(
true
);
$user_info
=
(
new
Request
())
->
post
(
$url
,
$params
);
$end
=
microtime
(
true
);
$total_time
=
round
((
$end
-
$begin
),
4
)
*
1000
;
if
(
!
empty
(
$user_info
[
'response'
])){
$code
=
$user_info
[
'response'
][
'code'
];
}
else
{
$code
=
-
1
;
}
MonUtil
::
proxyMon
(
$url
,
$code
,
'jw_user'
,
$total_time
);
FileLog
::
info
(
'jw_user_getUserByUserId'
,
json_encode
(
$user_info
));
if
(
!
$user_info
)
{
throw
new
CodeSpecialException
(
"timeout"
);
...
...
vendor/api/php_services/src/Ksy/Ks3Api.php
View file @
1b9dd0d7
...
...
@@ -47,7 +47,7 @@ class Ks3Api
"signature"
=>
$signature
,
"type"
=>
$type
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -59,12 +59,11 @@ class Ks3Api
* @param $headers
* @return array
*/
public
static
function
signature
(
$resource
,
$httpMethod
,
$contentType
,
$contentMd5
,
$headers
)
public
static
function
signature
(
$resource
,
$httpMethod
,
$contentType
,
$contentMd5
,
$headers
,
$date
)
{
$url
=
self
::
BASE_URL
.
self
::
PATH_SIGNATURE
;
$timestamp
=
self
::
msectime
();
$date
=
gmdate
(
self
::
KS_DATE_SCHEME
);
$md5Str
=
$httpMethod
.
"&"
.
$contentType
.
"&"
.
$contentMd5
.
"&"
.
$date
.
"&"
.
$resource
.
"&"
.
$headers
.
"&"
.
$timestamp
.
"&"
.
self
::
KSYUN_SK
;
$signature
=
self
::
KSYUN_AK
.
":"
.
md5
(
$md5Str
);
...
...
@@ -79,7 +78,7 @@ class Ks3Api
"resource"
=>
$resource
,
"headers"
=>
$headers
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -113,7 +112,7 @@ class Ks3Api
"content_type"
=>
$contentType
,
"extend"
=>
$extendJsonStr
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -140,7 +139,7 @@ class Ks3Api
"signature"
=>
$signature
,
"extend"
=>
$extendJsonStr
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
vendor/api/php_services/src/Ksy/Ksyun.php
View file @
1b9dd0d7
...
...
@@ -2,6 +2,7 @@
namespace
Api\PhpServices\Ksy
;
use
Api\PhpUtils\Http\Request
;
use
Api\PhpUtils\Mon\MonUtil
;
class
Ksyun
{
...
...
@@ -39,8 +40,16 @@ class Ksyun
'bucket'
=>
$bucket
,
'expire'
=>
$expire_time
,
];
$begin
=
microtime
(
true
);
$res
=
(
new
Request
())
->
post
(
self
::
get_down_from_ksyun
,
$post_data
,
50
,
'json'
,[],
1
,
true
);
$end
=
microtime
(
true
);
$total_time
=
round
((
$end
-
$begin
),
4
)
*
1000
;
if
(
isset
(
$res
[
'response'
][
'code'
])){
$code
=
$res
[
'response'
][
'code'
];
}
else
{
$code
=
-
1
;
}
MonUtil
::
proxyMon
(
self
::
get_down_from_ksyun
,
$code
,
'merchant'
,
$total_time
);
if
(
isset
(
$res
[
'code'
],
$res
[
'response'
][
'status'
])
&&
$res
[
'response'
][
'status'
]
===
'success'
)
{
return
$res
[
'response'
][
'data'
];
}
...
...
vendor/api/php_services/src/ShopImage/GetImage.php
View file @
1b9dd0d7
...
...
@@ -173,7 +173,7 @@ class GetImage
// 底部二维码
$qr
=
new
QR
(
$qr_string
);
$qr_size
=
1
21
;
$qr_size
=
1
00
;
$qr
->
setSize
(
$qr_size
);
$qr
->
setRoundBlockSize
(
QrCode
::
ROUND_BLOCK_SIZE_MODE_MARGIN
);
$qr_string
=
$qr
->
get
();
...
...
@@ -252,7 +252,44 @@ class GetImage
return
$image_thump
;
}
private
function
curlImage
(
$url
,
$save_dir
=
''
,
$filename
=
''
,
$type
=
0
){
$mimes
=
array
(
'image/bmp'
=>
'bmp'
,
'image/gif'
=>
'gif'
,
'image/jpeg'
=>
'jpg'
,
'image/png'
=>
'png'
,
'image/tiff'
=>
'tiff'
,
'image/x-icon'
=>
'ico'
,
'mage/vnd.wap.wbmp'
=>
'wbmp'
,
'image/fax'
=>
'fax'
,
'image/pnetvue'
=>
'net'
,
'image/vnd.rn-realpix'
=>
'rp'
);
//创建保存目录
if
(
!
file_exists
(
$save_dir
)
&&!
mkdir
(
$save_dir
,
0777
,
true
)){
return
false
;
}
// 获取响应头
if
((
$headers
=
get_headers
(
$url
,
1
))
!==
false
){
$type
=
$headers
[
'Content-Type'
];
if
(
isset
(
$mimes
[
$type
]))
{
$this
->
extension
=
$mimes
[
$type
];
$file_path
=
$save_dir
.
$filename
.
"."
.
$this
->
extension
;
$contents
=
file_get_contents
(
$url
);
if
(
file_put_contents
(
$file_path
,
$contents
))
{
return
$save_dir
.
$filename
.
"."
.
$this
->
extension
;
}
}
}
}
private
function
curlImageBak
(
$url
,
$save_dir
=
''
,
$filename
=
''
,
$type
=
0
){
if
(
trim
(
$url
)
==
''
){
return
array
(
'file_name'
=>
''
,
'save_path'
=>
''
,
'error'
=>
1
);
}
...
...
vendor/api/php_utils/src/Http/HttpUtil.php
View file @
1b9dd0d7
...
...
@@ -25,37 +25,104 @@ use Api\PhpUtils\Mon\MonUtil;
class
HttpUtil
{
// 成功
private
const
CODE_SUCCESS
=
0
;
// 失败
private
const
CODE_FAIL
=
999999
;
static
function
HEAD
(
$url
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* head 请求
* @param string $url 链接地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
head
(
string
$url
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'HEAD'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'HEAD'
);
}
static
function
GET
(
$url
,
$params
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
,
$curl_opts
=
array
())
/**
*
* @param string $url
* @param array $params
* @param int $timeout
* @param int $retries
* @param array $headers
* @param string $proxy
* @param array $curl_opts
* @return array
*/
public
static
function
get
(
string
$url
,
array
$params
=
[],
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
,
array
$curl_opts
=
[])
:
array
{
$url
=
$url
.
"?"
.
http_build_query
(
$params
);
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
[],
$proxy
,
'GET'
,
$curl_opts
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
[],
$proxy
,
'GET'
,
$curl_opts
);
}
static
function
PUT
(
$url
,
$post
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* 发起 curl put 请求
* @param string $url url 地址
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
put
(
string
$url
,
$post
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'PUT'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'PUT'
);
}
static
function
POST
(
$url
,
$post
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
,
$curl_opts
=
array
())
/**
* 发起 curl post 请求
* @param string $url url 地址
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @param array $curl_opts curl 参数
* @return array Response
*/
public
static
function
post
(
string
$url
,
$post
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
,
array
$curl_opts
=
[])
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'POST'
,
$curl_opts
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'POST'
,
$curl_opts
);
}
static
function
DELETE
(
$url
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* 发起 curl delete 请求
* @param string $url url 地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
delete
(
string
$url
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'DELETE'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'DELETE'
);
}
static
function
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
=
false
,
$proxy
=
false
,
$method
=
'GET'
,
$curl_opts
=
array
())
/**
* 发起 curl 请求
* @param string $url url 地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param string $proxy 代理地址
* @param string $method 请求方法
* @param array $curl_opts curl 参数
* @return array Response
*/
public
static
function
curl
(
string
$url
,
int
$timeout
,
int
$retries
,
array
$headers
,
$post
,
string
$proxy
=
''
,
string
$method
=
'GET'
,
array
$curl_opts
=
[])
:
array
{
$ch
=
self
::
CH
(
$url
,
$timeout
,
$headers
,
$post
,
$proxy
,
$method
,
$curl_opts
);
$ch
=
self
::
ch
(
$url
,
$timeout
,
$headers
,
$post
,
$proxy
,
$method
,
$curl_opts
);
$response
=
self
::
defaultResponse
();
...
...
@@ -115,17 +182,17 @@ class HttpUtil
}
/**
*
* @param $url
* @param $timeout
* @param
false
$headers
* @param
false
$post
* @param
false
$proxy
*
生产 curl句柄
* @param
string
$url
* @param
int
$timeout
* @param
array
$headers
* @param
mixed
$post
* @param
string
$proxy
* @param string $method
* @param array $curl_opts
* @return false|mixed|resource
*/
static
function
CH
(
$url
,
$timeout
,
$headers
=
false
,
$post
=
false
,
$proxy
=
false
,
$method
=
'GET'
,
$curl_opts
=
array
()
)
private
static
function
ch
(
string
$url
,
int
$timeout
,
array
$headers
=
[],
$post
,
string
$proxy
=
''
,
string
$method
=
'GET'
,
array
$curl_opts
=
[]
)
{
$ch
=
curl_init
(
$url
);
...
...
@@ -143,11 +210,11 @@ class HttpUtil
curl_setopt
(
$ch
,
CURLOPT_CONNECTTIMEOUT_MS
,
$timeout
);
curl_setopt
(
$ch
,
CURLOPT_HTTP_VERSION
,
CURL_HTTP_VERSION_1_0
);
if
(
$headers
!==
false
)
if
(
!
empty
(
$headers
)
)
{
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$headers
);
}
if
(
$proxy
!==
false
)
if
(
$proxy
)
{
curl_setopt
(
$ch
,
CURLOPT_PROXY
,
$proxy
);
}
...
...
@@ -182,16 +249,36 @@ class HttpUtil
}
return
$ch
;
}
static
function
MULTI_POST
(
$urls
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
)
/**
* 并发 curl
* @param array $urls 链接数组
* @param array $timeouts 超时时间数组(MS)
* @param array $posts POST数组 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
public
static
function
concurrencyPost
(
array
$urls
=
[],
array
$posts
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
$methods
=
[];
foreach
(
$urls
as
$k
=>
$url
)
{
$methods
[
$k
]
=
'POST'
;
}
return
self
::
MULTI_CURL
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
return
self
::
concurrencyCurl
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
}
static
function
MULTI_GET
(
$urls
=
[],
$params
=
[],
$timeouts
=
[],
$headers
=
[],
$proxies
=
[],
$curl_opts
=
[])
/**
* 并发 curl
* @param array $urls 链接数组
* @param array $timeouts 超时时间数组(MS)
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
public
static
function
concurrencyGet
(
array
$urls
=
[],
$params
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
$methods
=
$posts
=
[];
foreach
(
$urls
as
$k
=>
$url
)
{
...
...
@@ -200,22 +287,21 @@ class HttpUtil
$posts
[
$k
]
=
false
;
}
return
self
::
MULTI_CURL
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
return
self
::
concurrencyCurl
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
}
/**
*
* @param array $urls 链接
* @param array $methods 请求方法 (GET POST ...)
* @param array $posts POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $timeouts
* @param array $headers
* // * @param int $retry
* @param array $proxies
* @param array $curl_opts
* 并发 curl
* @param array $urls 链接数组
* @param array $methods 请求方法数组 (GET POST ...)
* @param array $posts POST数组 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $timeouts 超时时间数组(MS)
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
static
function
MULTI_CURL
(
$urls
=
[],
$methods
=
[],
$posts
=
[],
$timeouts
=
[],
$headers
=
[],
$proxies
=
[],
$curl_opts
=
[])
public
static
function
concurrencyCurl
(
array
$urls
=
[],
array
$methods
=
[],
array
$posts
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
//step one 初始化一个批处理handle
$mh
=
curl_multi_init
();
...
...
@@ -223,7 +309,7 @@ class HttpUtil
//step two 往批处理handle 添加curl_init来的子handle
foreach
(
$urls
as
$i
=>
$url
)
{
$ch
=
self
::
CH
(
$url
,
$timeouts
[
$i
],
$headers
[
$i
],
$posts
[
$i
],
$proxies
[
$i
],
$methods
[
$i
],
$curl_opts
);
$ch
=
self
::
CH
(
(
string
)
$url
,
(
int
)
$timeouts
[
$i
],
(
array
)
$headers
[
$i
],
$posts
[
$i
],
(
string
)
$proxies
[
$i
],
(
string
)
$methods
[
$i
],
(
array
)
$curl_opts
[
$i
]
);
$conn
[
$i
]
=
$ch
;
curl_multi_add_handle
(
$mh
,
$conn
[
$i
]);
...
...
@@ -264,10 +350,17 @@ class HttpUtil
/*
* 监控打点,模块名默认为第三方服务url,指标为请求返回的HTTP_code与总响应时间
*/
private
static
function
addMon
(
$url
,
$http_code
,
$request_time
)
{
private
static
function
addMon
(
string
$url
,
int
$http_code
,
float
$request_time
)
{
MonUtil
::
proxyMon
(
$url
,
$http_code
,
''
,
$request_time
);
}
/**
* 添加log
* @param $method
* @param $urls
* @param $params
* @param $response
*/
private
static
function
addLog
(
$method
,
$urls
,
$params
,
$response
)
{
//过滤无意义的日志
...
...
@@ -303,29 +396,38 @@ class HttpUtil
/**
* 过滤resource类型字段
* @param
array $arr
* @param
mixed $params array or string resource
* @return array
*/
private
static
function
change
(
$
arr
)
private
static
function
change
(
$
params
)
{
foreach
(
$arr
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
$arr
[
$k
]
=
self
::
change
(
$v
);
}
else
{
if
(
strpos
(
gettype
(
$v
),
'resource'
)
!==
false
)
{
$arr
[
$k
]
=
gettype
(
$v
);
if
(
is_array
(
$params
))
{
foreach
(
$params
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
$params
[
$k
]
=
self
::
change
(
$v
);
}
else
{
if
(
strpos
(
gettype
(
$v
),
'resource'
)
!==
false
)
{
$params
[
$k
]
=
gettype
(
$v
);
}
}
}
}
return
$arr
;
else
{
if
(
strpos
(
gettype
(
$params
),
'resource'
)
!==
false
)
{
$params
=
gettype
(
$params
);
}
}
return
$params
;
}
/**
* 生成返回结果
* @param string $response_content 请求返回结果
* @param resource $ch_handle cURL resource
* @return array
*/
private
static
function
createResponse
(
string
$response_content
,
$ch_handle
)
:
array
private
static
function
createResponse
(
string
$response_content
,
$ch_handle
)
:
array
{
return
[
'code'
=>
curl_errno
(
$ch_handle
)
===
0
?
self
::
CODE_SUCCESS
:
self
::
CODE_FAIL
,
...
...
vendor/api/php_utils/src/Lock/FrequencyLockUtil.php
View file @
1b9dd0d7
...
...
@@ -10,7 +10,7 @@ use Api\PhpUtils\Redis\RedisUtil;
class
FrequencyLockUtil
{
const
MIN_FREQUENCY_SECONDS
=
3
0
;
// 频率锁默认最小间隔秒数
const
MIN_FREQUENCY_SECONDS
=
3
;
// 频率锁默认最小间隔秒数
const
MIN_FREQUENCY_TIMES
=
1
;
// 频率锁默认最小间隔秒数内最大访问次数
const
PREFIX_FREQUENCY_LOCK
=
'flk:'
;
...
...
@@ -41,7 +41,7 @@ class FrequencyLockUtil
if
(
$current_times
==
1
)
{
self
::
$handler
->
expire
(
$key
,
$expire
);
}
return
(
$current_times
>
$times
)
?
false
:
tru
e
;
return
(
$current_times
>
$times
)
?
true
:
fals
e
;
}
/**
...
...
vendor/api/php_utils/src/Mysql/MysqlBase.php
View file @
1b9dd0d7
...
...
@@ -173,6 +173,10 @@ abstract class MysqlBase
*/
public
static
function
getConnection
(
$type
,
$flush
=
false
)
{
if
(
PHP_SAPI
==
'cli'
){
// cli模式下,不走单例,gone away
$flush
=
true
;
}
if
(
!
isset
(
self
::
$dbConnect
[
static
::
CONFIG_INDEX
.
':'
.
$type
])
||
$flush
)
{
self
::
$dbConnect
[
static
::
CONFIG_INDEX
.
':'
.
$type
]
=
new
Medoo
(
self
::
getDbConf
(
$type
));
}
...
...
@@ -495,4 +499,20 @@ abstract class MysqlBase
self
::
$dbConnect
[
static
::
CONFIG_INDEX
.
':'
.
$type
]
=
self
::
getConnection
(
$type
);
return
self
::
$dbConnect
[
static
::
CONFIG_INDEX
.
':'
.
$type
]
->
action
(
$actions
);
}
/**
* 销毁所有已存在的连接,守护进程需要手动调用
*
* @return void
*/
public
static
function
destroyConnetion
()
{
if
(
self
::
$dbConnect
)
{
foreach
(
self
::
$dbConnect
as
$conn
)
{
$conn
->
pdo
=
null
;
unset
(
$conn
);
}
self
::
$dbConnect
=
[];
}
}
}
vendor/composer/InstalledVersions.php
View file @
1b9dd0d7
...
...
@@ -32,7 +32,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
68ce832c192189e953b0bb2c9ce62aa9e5a5c3db
'
,
'name'
=>
'yidian/yaf_demo'
,
),
'versions'
=>
...
...
@@ -45,7 +45,7 @@ private static $installed = array (
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
f7b44c008d561d3785797073d0eb875fb2f16756
'
,
'reference'
=>
'
cc3be45aa9bfc968b35f1d60c43115dae5f80da3
'
,
),
'api/php_utils'
=>
array
(
...
...
@@ -55,7 +55,7 @@ private static $installed = array (
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
e4bc1258fafead42eb6ac7b84ae743f08d557a99
'
,
'reference'
=>
'
44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4
'
,
),
'bacon/bacon-qr-code'
=>
array
(
...
...
@@ -196,11 +196,10 @@ private static $installed = array (
),
'psr/log'
=>
array
(
'pretty_version'
=>
'
dev-master
'
,
'version'
=>
'
dev-master
'
,
'pretty_version'
=>
'
1.1.4
'
,
'version'
=>
'
1.1.4.0
'
,
'aliases'
=>
array
(
0
=>
'1.1.x-dev'
,
),
'reference'
=>
'd49695b909c3b7628b6289db5479a1c204601f11'
,
),
...
...
@@ -299,7 +298,7 @@ private static $installed = array (
array
(
0
=>
'1.23.x-dev'
,
),
'reference'
=>
'
eca0bf41ed421bed1b57c4958bab16aa86b757d0
'
,
'reference'
=>
'
19d03c391c6abb6791f5f757fb36e551bffeaa68
'
,
),
'symfony/property-access'
=>
array
(
...
...
@@ -308,7 +307,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
13c33f29a76bd99976ba7ee20297fa16d5a53a59
'
,
'reference'
=>
'
cb1aad06e7733a116f49033b1b3048a08e59ddd2
'
,
),
'symfony/property-info'
=>
array
(
...
...
@@ -317,7 +316,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
718f093ae4cac054db2bbb39ebf86fd898583ac8
'
,
'reference'
=>
'
36f5c26e3dbf6873b61b593cd86fe4616153d239
'
,
),
'symfony/string'
=>
array
(
...
...
@@ -335,7 +334,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
68ce832c192189e953b0bb2c9ce62aa9e5a5c3db
'
,
),
),
);
...
...
vendor/composer/autoload_classmap.php
View file @
1b9dd0d7
...
...
@@ -102,6 +102,7 @@ return array(
'App\\Models\\goods\\mysql\\GoodsSnapshot'
=>
$baseDir
.
'/application/models/goods/mysql/GoodsSnapshot.php'
,
'App\\Models\\goods\\mysql\\GoodsSpu'
=>
$baseDir
.
'/application/models/goods/mysql/GoodsSpu.php'
,
'App\\Models\\goods\\mysql\\InventoryOperationRecord'
=>
$baseDir
.
'/application/models/goods/mysql/InventoryOperationRecord.php'
,
'App\\Models\\goods\\mysql\\LifeAccountShopNum'
=>
$baseDir
.
'/application/models/goods/mysql/LifeAccountShopNum.php'
,
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord'
=>
$baseDir
.
'/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php'
,
'App\\Models\\goods\\mysql\\Shop'
=>
$baseDir
.
'/application/models/goods/mysql/Shop.php'
,
'App\\Models\\goods\\mysql\\Tcc'
=>
$baseDir
.
'/application/models/goods/mysql/Tcc.php'
,
...
...
vendor/composer/autoload_static.php
View file @
1b9dd0d7
...
...
@@ -331,6 +331,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'App\\Models\\goods\\mysql\\GoodsSnapshot'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/GoodsSnapshot.php'
,
'App\\Models\\goods\\mysql\\GoodsSpu'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/GoodsSpu.php'
,
'App\\Models\\goods\\mysql\\InventoryOperationRecord'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/InventoryOperationRecord.php'
,
'App\\Models\\goods\\mysql\\LifeAccountShopNum'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/LifeAccountShopNum.php'
,
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php'
,
'App\\Models\\goods\\mysql\\Shop'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/Shop.php'
,
'App\\Models\\goods\\mysql\\Tcc'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/Tcc.php'
,
...
...
vendor/composer/installed.json
View file @
1b9dd0d7
...
...
@@ -7,7 +7,7 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://git.yidian-inc.com:8021/bp/php_services.git"
,
"reference"
:
"
f7b44c008d561d3785797073d0eb875fb2f16756
"
"reference"
:
"
cc3be45aa9bfc968b35f1d60c43115dae5f80da3
"
},
"require"
:
{
"api/php_utils"
:
"dev-master"
,
...
...
@@ -15,7 +15,7 @@
"perftools/php-profiler"
:
"^0.18.0"
,
"php"
:
"7.2.*"
},
"time"
:
"2021-07-1
4T09:06:17
+00:00"
,
"time"
:
"2021-07-1
9T12:51:28
+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"installation-source"
:
"source"
,
...
...
@@ -34,7 +34,7 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://git.yidian-inc.com:8021/bp/php_utils.git"
,
"reference"
:
"
e4bc1258fafead42eb6ac7b84ae743f08d557a99
"
"reference"
:
"
44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4
"
},
"require"
:
{
"elasticsearch/elasticsearch"
:
"~7.0"
,
...
...
@@ -46,7 +46,7 @@
"mongodb/mongodb"
:
"1.4.3"
,
"php"
:
"7.2.*"
},
"time"
:
"2021-07-1
4T08:30:41
+00:00"
,
"time"
:
"2021-07-1
9T16:13:22
+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"installation-source"
:
"source"
,
...
...
@@ -950,8 +950,8 @@
},
{
"name"
:
"psr/log"
,
"version"
:
"
dev-master
"
,
"version_normalized"
:
"
dev-master
"
,
"version"
:
"
1.1.4
"
,
"version_normalized"
:
"
1.1.4.0
"
,
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/php-fig/log.git"
,
...
...
@@ -967,7 +967,6 @@
"php"
:
">=5.3.0"
},
"time"
:
"2021-05-03T11:20:27+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"extra"
:
{
"branch-alias"
:
{
...
...
@@ -1685,18 +1684,18 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/symfony/polyfill-php80.git"
,
"reference"
:
"
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
"reference"
:
"
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/symfony/polyfill-php80/zipball/
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
,
"reference"
:
"
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
,
"url"
:
"https://api.github.com/repos/symfony/polyfill-php80/zipball/
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
,
"reference"
:
"
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
,
"shasum"
:
""
},
"require"
:
{
"php"
:
">=7.1"
},
"time"
:
"2021-0
2-19T12:13:01
+00:00"
,
"time"
:
"2021-0
7-13T14:34:27
+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"extra"
:
{
...
...
@@ -1747,7 +1746,7 @@
"shim"
],
"support"
:
{
"source"
:
"https://github.com/symfony/polyfill-php80/tree/
v1.23.0
"
"source"
:
"https://github.com/symfony/polyfill-php80/tree/
main
"
},
"funding"
:
[
{
...
...
@@ -1772,12 +1771,12 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/symfony/property-access.git"
,
"reference"
:
"
13c33f29a76bd99976ba7ee20297fa16d5a53a59
"
"reference"
:
"
cb1aad06e7733a116f49033b1b3048a08e59ddd2
"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/symfony/property-access/zipball/
13c33f29a76bd99976ba7ee20297fa16d5a53a59
"
,
"reference"
:
"
13c33f29a76bd99976ba7ee20297fa16d5a53a59
"
,
"url"
:
"https://api.github.com/repos/symfony/property-access/zipball/
cb1aad06e7733a116f49033b1b3048a08e59ddd2
"
,
"reference"
:
"
cb1aad06e7733a116f49033b1b3048a08e59ddd2
"
,
"shasum"
:
""
},
"require"
:
{
...
...
@@ -1792,7 +1791,7 @@
"suggest"
:
{
"psr/cache-implementation"
:
"To cache access methods."
},
"time"
:
"2021-07-
03T09:16:21
+00:00"
,
"time"
:
"2021-07-
17T18:34:10
+00:00"
,
"type"
:
"library"
,
"installation-source"
:
"dist"
,
"autoload"
:
{
...
...
@@ -1856,12 +1855,12 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/symfony/property-info.git"
,
"reference"
:
"
718f093ae4cac054db2bbb39ebf86fd898583ac8
"
"reference"
:
"
36f5c26e3dbf6873b61b593cd86fe4616153d239
"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/symfony/property-info/zipball/
718f093ae4cac054db2bbb39ebf86fd898583ac8
"
,
"reference"
:
"
718f093ae4cac054db2bbb39ebf86fd898583ac8
"
,
"url"
:
"https://api.github.com/repos/symfony/property-info/zipball/
36f5c26e3dbf6873b61b593cd86fe4616153d239
"
,
"reference"
:
"
36f5c26e3dbf6873b61b593cd86fe4616153d239
"
,
"shasum"
:
""
},
"require"
:
{
...
...
@@ -1888,7 +1887,7 @@
"symfony/doctrine-bridge"
:
"To use Doctrine metadata"
,
"symfony/serializer"
:
"To use Serializer metadata"
},
"time"
:
"2021-07-
03T09:16
:21+00:00"
,
"time"
:
"2021-07-
18T16:31
:21+00:00"
,
"type"
:
"library"
,
"installation-source"
:
"dist"
,
"autoload"
:
{
...
...
vendor/composer/installed.php
View file @
1b9dd0d7
...
...
@@ -6,7 +6,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
68ce832c192189e953b0bb2c9ce62aa9e5a5c3db
'
,
'name'
=>
'yidian/yaf_demo'
,
),
'versions'
=>
...
...
@@ -19,7 +19,7 @@
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
f7b44c008d561d3785797073d0eb875fb2f16756
'
,
'reference'
=>
'
cc3be45aa9bfc968b35f1d60c43115dae5f80da3
'
,
),
'api/php_utils'
=>
array
(
...
...
@@ -29,7 +29,7 @@
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
e4bc1258fafead42eb6ac7b84ae743f08d557a99
'
,
'reference'
=>
'
44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4
'
,
),
'bacon/bacon-qr-code'
=>
array
(
...
...
@@ -170,11 +170,10 @@
),
'psr/log'
=>
array
(
'pretty_version'
=>
'
dev-master
'
,
'version'
=>
'
dev-master
'
,
'pretty_version'
=>
'
1.1.4
'
,
'version'
=>
'
1.1.4.0
'
,
'aliases'
=>
array
(
0
=>
'1.1.x-dev'
,
),
'reference'
=>
'd49695b909c3b7628b6289db5479a1c204601f11'
,
),
...
...
@@ -273,7 +272,7 @@
array
(
0
=>
'1.23.x-dev'
,
),
'reference'
=>
'
eca0bf41ed421bed1b57c4958bab16aa86b757d0
'
,
'reference'
=>
'
19d03c391c6abb6791f5f757fb36e551bffeaa68
'
,
),
'symfony/property-access'
=>
array
(
...
...
@@ -282,7 +281,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
13c33f29a76bd99976ba7ee20297fa16d5a53a59
'
,
'reference'
=>
'
cb1aad06e7733a116f49033b1b3048a08e59ddd2
'
,
),
'symfony/property-info'
=>
array
(
...
...
@@ -291,7 +290,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
718f093ae4cac054db2bbb39ebf86fd898583ac8
'
,
'reference'
=>
'
36f5c26e3dbf6873b61b593cd86fe4616153d239
'
,
),
'symfony/string'
=>
array
(
...
...
@@ -309,7 +308,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
68ce832c192189e953b0bb2c9ce62aa9e5a5c3db
'
,
),
),
);
vendor/symfony/polyfill-php80/README.md
View file @
1b9dd0d7
...
...
@@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core:
-
[
`get_resource_id`
](
https://php.net/get_resource_id
)
More information can be found in the
[
main Polyfill README
](
https://github.com/symfony/polyfill/blob/ma
ster
/README.md
)
.
[
main Polyfill README
](
https://github.com/symfony/polyfill/blob/ma
in
/README.md
)
.
License
=======
...
...
vendor/symfony/property-access/PropertyAccessor.php
View file @
1b9dd0d7
...
...
@@ -630,7 +630,7 @@ class PropertyAccessor implements PropertyAccessorInterface
private
function
getWriteInfo
(
string
$class
,
string
$property
,
$value
)
:
PropertyWriteInfo
{
$useAdderAndRemover
=
\is_array
(
$value
)
||
$value
instanceof
\Traversable
;
$useAdderAndRemover
=
is_iterable
(
$value
)
;
$key
=
str_replace
(
'\\'
,
'.'
,
$class
)
.
'..'
.
$property
.
'..'
.
(
int
)
$useAdderAndRemover
;
if
(
isset
(
$this
->
writePropertyCache
[
$key
]))
{
...
...
vendor/symfony/property-info/Extractor/PhpDocExtractor.php
View file @
1b9dd0d7
...
...
@@ -66,9 +66,9 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
$this
->
docBlockFactory
=
$docBlockFactory
?:
DocBlockFactory
::
createInstance
();
$this
->
contextFactory
=
new
ContextFactory
();
$this
->
phpDocTypeHelper
=
new
PhpDocTypeHelper
();
$this
->
mutatorPrefixes
=
null
!==
$mutatorPrefixes
?
$mutatorPrefixes
:
ReflectionExtractor
::
$defaultMutatorPrefixes
;
$this
->
accessorPrefixes
=
null
!==
$accessorPrefixes
?
$accessorPrefixes
:
ReflectionExtractor
::
$defaultAccessorPrefixes
;
$this
->
arrayMutatorPrefixes
=
null
!==
$arrayMutatorPrefixes
?
$arrayMutatorPrefixes
:
ReflectionExtractor
::
$defaultArrayMutatorPrefixes
;
$this
->
mutatorPrefixes
=
$mutatorPrefixes
??
ReflectionExtractor
::
$defaultMutatorPrefixes
;
$this
->
accessorPrefixes
=
$accessorPrefixes
??
ReflectionExtractor
::
$defaultAccessorPrefixes
;
$this
->
arrayMutatorPrefixes
=
$arrayMutatorPrefixes
??
ReflectionExtractor
::
$defaultArrayMutatorPrefixes
;
}
/**
...
...
vendor/symfony/property-info/Extractor/ReflectionExtractor.php
View file @
1b9dd0d7
...
...
@@ -85,9 +85,9 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
*/
public
function
__construct
(
array
$mutatorPrefixes
=
null
,
array
$accessorPrefixes
=
null
,
array
$arrayMutatorPrefixes
=
null
,
bool
$enableConstructorExtraction
=
true
,
int
$accessFlags
=
self
::
ALLOW_PUBLIC
,
InflectorInterface
$inflector
=
null
,
int
$magicMethodsFlags
=
self
::
ALLOW_MAGIC_GET
|
self
::
ALLOW_MAGIC_SET
)
{
$this
->
mutatorPrefixes
=
null
!==
$mutatorPrefixes
?
$mutatorPrefixes
:
self
::
$defaultMutatorPrefixes
;
$this
->
accessorPrefixes
=
null
!==
$accessorPrefixes
?
$accessorPrefixes
:
self
::
$defaultAccessorPrefixes
;
$this
->
arrayMutatorPrefixes
=
null
!==
$arrayMutatorPrefixes
?
$arrayMutatorPrefixes
:
self
::
$defaultArrayMutatorPrefixes
;
$this
->
mutatorPrefixes
=
$mutatorPrefixes
??
self
::
$defaultMutatorPrefixes
;
$this
->
accessorPrefixes
=
$accessorPrefixes
??
self
::
$defaultAccessorPrefixes
;
$this
->
arrayMutatorPrefixes
=
$arrayMutatorPrefixes
??
self
::
$defaultArrayMutatorPrefixes
;
$this
->
enableConstructorExtraction
=
$enableConstructorExtraction
;
$this
->
methodReflectionFlags
=
$this
->
getMethodsFlags
(
$accessFlags
);
$this
->
propertyReflectionFlags
=
$this
->
getPropertyFlags
(
$accessFlags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment