Commit 9d491bad authored by suntengda's avatar suntengda

Merge branch 'pindan_activity_list_optimize' into test

# Conflicts:
#	vendor/composer/installed.json
parents e1af227f e6d987c2
<?php <?php
use Api\PhpUtils\Log\FileLog;
use App\Base\Base; use App\Base\Base;
use App\Services\marketing\MarketingService; use App\Services\marketing\MarketingService;
use App\Exception\custom\MarketingException; use App\Exception\custom\MarketingException;
...@@ -8,8 +7,6 @@ use App\Services\marketing\MarketingGoodsService; ...@@ -8,8 +7,6 @@ use App\Services\marketing\MarketingGoodsService;
use \Validate\MarketingGoodsRateValidate; use \Validate\MarketingGoodsRateValidate;
use \Validate\MarketingOnlineStatusValidate; use \Validate\MarketingOnlineStatusValidate;
use \Validate\MarketingInfoValidate; use \Validate\MarketingInfoValidate;
use App\Models\marketing\mysql\Marketing;
use App\Models\marketing\mysql\MarketingPindan;
use Api\PhpUtils\Redis\RedisUtil; use Api\PhpUtils\Redis\RedisUtil;
class MarketingController extends Base class MarketingController extends Base
...@@ -165,104 +162,52 @@ class MarketingController extends Base ...@@ -165,104 +162,52 @@ class MarketingController extends Base
*/ */
public function tuancan_listAction() public function tuancan_listAction()
{ {
$this->params['marketing_type'] = Marketing::MARKETING_TYPE_PINDAN;//1分销 2团购 3秒杀 4团餐 $page = $this->params['page'] ?? 1;
$this->params['online_status'] = Marketing::ONLINE_STATUS_QIDONG;//状态 , 1启用,2关闭,3 到期 $pageSize = $this->params['page_size'] ?? 20;
$this->params['from'] = 1;//1 小程序前台 默认0 后台
//正在进行中的 按结束时间正序
$this->params['sort_field'] = 'end_time';
$this->params['sort_type'] = 'asc';
$this->params['need_buy_num'] = false;
$this->params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS;//1 未开始,2进行中,3已结束
$list['doing'] = MarketingService::marketingList($this->params)['result'];
$list['doing'] = $list['doing'] ? array_column($list['doing'], null, 'marketing_id') : [];
$marketingIdsDoing = array_keys($list['doing']);
//当天即将开始的 按开始时间正序
$this->params['page'] = 1;
$this->params['sort_field'] = 'start_time';
$this->params['sort_type'] = 'asc';
$this->params['need_buy_num'] = false;
$this->params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_START_TODAY;//1 未开始,2进行中,3已结束, 4当日上新(即将开始)
$list['prepare'] = MarketingService::marketingList($this->params)['result'];
$list['prepare'] = $list['prepare'] ? array_column((array)$list['prepare'], null, 'marketing_id') : [];
$marketingIdsPrepare = array_keys($list['prepare']);
$marketingIds = array_merge($marketingIdsDoing, $marketingIdsPrepare);
$list = $this->_fillSkuAndOrderInfo($marketingIds,$list);
//已结束的 按结束时间倒序
$list['end'] = $this->getTuanCanEndList();
$list = MarketingService::getPindanActiveAndReadyList($page,$pageSize);
$list['end'] = MarketingService::getPindanEndList($page,$pageSize);
$list['life_account_id'] = MarketingService::getPublicLifeAccountId(); $list['life_account_id'] = MarketingService::getPublicLifeAccountId();
$this->success(['result' => $list]); $this->success(['result' => $list]);
} }
private function getTuanCanEndList(){
try{
$redis = RedisUtil::getInstance('cache',['serializer'=>'none']);
$key = "tuancan_end_list_in_".date('Ymd');
$list['end'] = $redis->get($key);
if(empty($list['end'])) {
$this->params['page'] = 1;
$this->params['page_size'] = 10;
$this->params['sort_field'] = 'end_time';
$this->params['sort_type'] = 'desc';
$this->params['need_buy_num'] = false;
$this->params['online_status'] = [Marketing::ONLINE_STATUS_QIDONG, Marketing::ONLINE_STATUS_GUANBI, Marketing::ONLINE_STATUS_DAOQI];//状态 , 1启用,2关闭,3 到期
$this->params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_FINISHED;//1 未开始,2进行中,3已结束, 4当日上新(即将开始)
$list['end'] = MarketingService::marketingList($this->params)['result'];
$list['end'] = $list['end'] ? array_column($list['end'], null, 'marketing_id') : [];
$marketingIdsEnd = array_keys($list['end']);
$list = $this->_fillSkuAndOrderInfo($marketingIdsEnd,$list);
$redis->set($key,json_encode($list['end']),['ex'=>86400]);//已结束列表 缓存一天
}else {
$list['end'] = json_decode($list['end'], true);
}
}catch (Exception $e) {
FileLog::error("获取团餐已结束列表异常", $e->getMessage(), '', 'suntengda@yidian-inc.com');
}
return $list['end'] ?? [];
}
/** /**
* 给列表填充sku和订单相关信息 * 正在进行中的活动简单信息列表
* @param $marketingIds
* @param $list
* @return mixed
* @throws \App\Exception\custom\InterfaceException * @throws \App\Exception\custom\InterfaceException
*/ */
private function _fillSkuAndOrderInfo($marketingIds,$list) { public function pindan_active_basic_listAction()
//获取活动的sku列表 {
$skuList = MarketingService::getGoodsSkuListByMarketingIds($marketingIds); $excludeMarketingId = $this->params['exclude_marketing_id'] ?? '';
//获取活动支付用户列表 $limit = $this->params['limit'] ?? 1;
$orderUser = MarketingService::getMarketingOrderUser(['marketing_id' => $marketingIds]); $list = MarketingService::pindanActiveBasicList($excludeMarketingId,$limit,true);
//获取活动支付用户数 $this->success(['result' => $list]);
$buyNum = MarketingService::getHaveBuyGoodsUserCount(['marketing_id' => $marketingIds]);
//组合sku和order信息
foreach ($list as &$listPart) {
foreach ($listPart as $marketingId => &$value) {
$value['sku_list'] = $skuList[$marketingId] ?? [];
$value['order_user'] = $orderUser[$marketingId] ?? [];
$value['participate_number'] = $buyNum[$marketingId] ?? 0;
}
unset($value);
$listPart = array_values($listPart);
} }
unset($listPart);
return $list; /**
* 正在进行和未开始的拼单活动列表
* @throws \App\Exception\custom\InterfaceException
*/
public function pindan_active_and_ready_listAction()
{
$page = $this->params['page'] ?? 1;
$pageSize = $this->params['page_size'] ?? 50;
$list = MarketingService::getPindanActiveAndReadyList($page,$pageSize);
$this->success(['result' => $list]);
} }
/**
*
* @throws Exception
*/
public function pindan_end_listAction()
{
$limit = $this->params['limit'] ?? 5;
$useCache = $this->params['use_cache'] ?? true;
$list = MarketingService::getPindanEndList(1,$limit,$useCache);
$this->success(['result' => $list]);
}
/** /**
* 切换活动状态 * 切换活动状态
...@@ -285,4 +230,30 @@ class MarketingController extends Base ...@@ -285,4 +230,30 @@ class MarketingController extends Base
$lists = MarketingService::yingxiaoList($this->params); $lists = MarketingService::yingxiaoList($this->params);
$this->success(['result' => $lists]); $this->success(['result' => $lists]);
} }
/**
* 小程序审核查询设置safe_mode版本号
* @throws Exception
*/
public function get_small_program_configAction()
{
$redis = RedisUtil::getInstance('cache',['serializer'=>'none']);
$key = "small_program_config";
$value = $redis->get($key);
$this->success(['result' => $value]);
}
/**
* 小程序审核设置safe_mode版本号
* @throws Exception
*/
public function set_small_program_configAction()
{
$params = $this->params;
$cvVersion = empty($params["version"]) ? "" : $params["version"];
$redis = RedisUtil::getInstance('cache',['serializer'=>'none']);
$key = "small_program_config";
$res = $redis->set($key, $cvVersion);
$this->success(['result' => $res]);
}
} }
\ No newline at end of file
...@@ -24,6 +24,9 @@ use App\Services\common\KafkaService; ...@@ -24,6 +24,9 @@ use App\Services\common\KafkaService;
use App\Services\goods\GoodsService; use App\Services\goods\GoodsService;
use Daemon\Goods; use Daemon\Goods;
use App\Exception\custom\GoodsException; use App\Exception\custom\GoodsException;
use Api\PhpUtils\Redis\RedisUtil;
use Api\PhpUtils\Log\FileLog;
use Helpers\DebugLog;
class MarketingService class MarketingService
{ {
...@@ -279,13 +282,13 @@ class MarketingService ...@@ -279,13 +282,13 @@ class MarketingService
$page = ($params['page'] - 1) * $limit; $page = ($params['page'] - 1) * $limit;
//排序规则 //排序规则
$sortField = $params['sort_field'] ?? 'update_time'; $sortField = $params['sort_field'] ?? 'update_time';
$sortType = isset($params['sort_type']) ? strtoupper($params['sort_type']) : 'desc'; $sortType = isset($params['sort_type']) ? strtoupper($params['sort_type']) : 'DESC';
//验证sort合法性 //验证sort合法性
if(!in_array($params['sort_field'],['create_time','update_time','end_time','start_time'])) { if(!in_array($sortField,['create_time','update_time','end_time','start_time'])) {
$sortField = 'update_time'; $sortField = 'update_time';
} }
if(!in_array($params['sort_type'],['asc','desc'])) { if(!in_array($sortType,['ASC','DESC'])) {
$sortType = 'DESC'; $sortType = 'DESC';
} }
...@@ -297,33 +300,14 @@ class MarketingService ...@@ -297,33 +300,14 @@ class MarketingService
$where['online_status'] = $params['online_status']; $where['online_status'] = $params['online_status'];
} }
$now = date("Y-m-d H:i:s"); $where += self::getStartEndTimeFilter($params['activity_status'],$params['from']);
if ($params["activity_status"] == MarketingPindan::ACTIVITY_STATUS_NO_START) {
$where["start_time[>]"] = $now;
} elseif ($params["activity_status"] == MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS) {
$where["start_time[<=]"] = $now;
$where["end_time[>=]"] = $now;
} elseif ($params["activity_status"] == MarketingPindan::ACTIVITY_STATUS_FINISHED) {
$where["end_time[<]"] = $now;
//七日内结束的活动
if (!empty($params['from']) && $params['from'] == 1) {
$beforeSevenDay = date("Y-m-d H:i:s", strtotime("-7 day"));
$where["end_time[>]"] = $beforeSevenDay;
}
} elseif ($params["activity_status"] == MarketingPindan::ACTIVITY_STATUS_START_TODAY) {//今日上新-未开始
$where["start_time[>]"] = $now;
$where["start_time[<=]"] = date("Y-m-d 00:00:00",strtotime('+1 days'));
$where["end_time[>=]"] = $now;
}
$where['life_account_id'] = self::getPublicLifeAccountId(); $where['life_account_id'] = self::getPublicLifeAccountId();
$where['ORDER'] = [$sortField => $sortType]; $where['ORDER'] = [$sortField => $sortType];
$where['LIMIT'] = [$page, $limit]; $where['LIMIT'] = [$page, $limit];
$list = Marketing::select(["marketing_id", "marketing_name", "start_time", "end_time", $list = Marketing::select(["marketing_id", "marketing_name", "start_time", "end_time",
"online_status", "update_time", "create_time"] "online_status", "update_time", "create_time"]
, $where); , $where);
$lists = []; $lists = [];
if (!empty($list)) { if (!empty($list)) {
$marketingIds = []; $marketingIds = [];
...@@ -336,20 +320,27 @@ class MarketingService ...@@ -336,20 +320,27 @@ class MarketingService
}else { }else {
$userCount = []; $userCount = [];
} }
$marketingPindanData = MarketingPindan::select(["marketing_id", "publish_life_account_id", $marketingPindanData = MarketingPindan::select(["marketing_id", "publish_life_account_id",
"min_price", "max_price", "pindan_desc","participate_number", "pindan_pic"] "min_price", "max_price", "pindan_desc","participate_number", "pindan_pic"]
, ["marketing_id" => $marketingIds]); , ["marketing_id" => $marketingIds]);
$priceData = []; if(empty($marketingPindanData)) {
if (!empty($marketingPindanData)) { return ['result' => [],'count' => 0];
}
$priceData = $picIds = [];
foreach ($marketingPindanData as $item) { foreach ($marketingPindanData as $item) {
$priceData[$item["marketing_id"]] = $item; $priceData[$item["marketing_id"]] = $item;
$priceData[$item["marketing_id"]]['pindan_pic'] = $item['pindan_pic'] ? explode(',',$item['pindan_pic']) : [];
$picIds = array_merge($picIds,$priceData[$item["marketing_id"]]['pindan_pic']);
} }
}
//获取图片
$picUrl = Ks3Api::concurrencyPicEncryptUrl($picIds);
//获取生活号信息
$publishLifeAccountIds = array_unique(array_column($marketingPindanData, "publish_life_account_id")); $publishLifeAccountIds = array_unique(array_column($marketingPindanData, "publish_life_account_id"));
$lifeAccountList = CommonService::getlifeAccountList(['life_account_id' => $publishLifeAccountIds]); $lifeAccountList = CommonService::getlifeAccountList(['life_account_id' => $publishLifeAccountIds]);
$defaultPic = "SHQ_goods_0_012Xh1AQcMqu"; $defaultPic = "SHQ_goods_0_012Xh1AQcMqu";
foreach ($list as $key => $value) { foreach ($list as $key => $value) {
$lists[$key] = $value; $lists[$key] = $value;
$lists[$key]["online_status_desc"] = Marketing::$onlineStatusDesc[$value["online_status"]]; $lists[$key]["online_status_desc"] = Marketing::$onlineStatusDesc[$value["online_status"]];
...@@ -362,10 +353,16 @@ class MarketingService ...@@ -362,10 +353,16 @@ class MarketingService
$lists[$key]["life_account_name"] = $lifeAccountList[$currentLifeAccountId]["life_account_name"]; $lists[$key]["life_account_name"] = $lifeAccountList[$currentLifeAccountId]["life_account_name"];
} }
$picUrl = GoodsService::getUrlList($priceData[$value["marketing_id"]]["pindan_pic"]);
$lists[$key]["min_price"] = sprintf("%.2f", $priceData[$value["marketing_id"]]["min_price"] / 100); $lists[$key]["min_price"] = sprintf("%.2f", $priceData[$value["marketing_id"]]["min_price"] / 100);
$lists[$key]["max_price"] = sprintf("%.2f", $priceData[$value["marketing_id"]]["max_price"] / 100); $lists[$key]["max_price"] = sprintf("%.2f", $priceData[$value["marketing_id"]]["max_price"] / 100);
$lists[$key]["pindan_pic_url"] = $picUrl;
if($priceData[$value["marketing_id"]]['pindan_pic']) {
foreach($priceData[$value["marketing_id"]]["pindan_pic"] as $picId) {
$lists[$key]["pindan_pic_url"][] = $picUrl[$picId];
}
}else {
$lists[$key]["pindan_pic_url"] = [];
}
$lists[$key]["pindan_desc"] = $priceData[$value["marketing_id"]]["pindan_desc"]; $lists[$key]["pindan_desc"] = $priceData[$value["marketing_id"]]["pindan_desc"];
$lists[$key]["participate_number"] = empty($userCount[$value['marketing_id']]) ? 0 : $userCount[$value['marketing_id']]; $lists[$key]["participate_number"] = empty($userCount[$value['marketing_id']]) ? 0 : $userCount[$value['marketing_id']];
...@@ -382,9 +379,197 @@ class MarketingService ...@@ -382,9 +379,197 @@ class MarketingService
unset($where['LIMIT']); unset($where['LIMIT']);
unset($where['ORDER']); unset($where['ORDER']);
$count = Marketing::count("*", $where); $count = Marketing::count("*", $where);
return ['result' => $lists,'count' => $count]; return ['result' => $lists,'count' => $count];
} }
private static function getStartEndTimeFilter($activityStatus,$from='') {
$where = [];
$now = date("Y-m-d H:i:s");
if ($activityStatus == MarketingPindan::ACTIVITY_STATUS_NO_START) {
$where["start_time[>]"] = $now;
} elseif ($activityStatus == MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS) {
$where["start_time[<=]"] = $now;
$where["end_time[>=]"] = $now;
} elseif ($activityStatus == MarketingPindan::ACTIVITY_STATUS_FINISHED) {
$where["end_time[<]"] = $now;
//七日内结束的活动
if ($from == 1) {
$beforeSevenDay = date("Y-m-d H:i:s", strtotime("-7 day"));
$where["end_time[>]"] = $beforeSevenDay;
}
} elseif ($activityStatus == MarketingPindan::ACTIVITY_STATUS_START_TODAY) {//今日上新-未开始
$where["start_time[>]"] = $now;
$where["start_time[<=]"] = date("Y-m-d 00:00:00",strtotime('+1 days'));
$where["end_time[>=]"] = $now;
}
return $where;
}
/**
* 正在进行中的活动简单信息列表
* @param $excludeMarketingId
* @param int $limit
* @param bool $needSkuList
* @return \Api\PhpUtils\Mysql\MysqlBase|array
* @throws InterfaceException
*/
public static function pindanActiveBasicList($excludeMarketingId='',$limit=2,$needSkuList=true)
{
$limit += 1;//查询结果需要排除掉传递的活动,所以需要多取一条
$where["marketing_type"] = Marketing::MARKETING_TYPE_PINDAN;
$where['online_status'] = Marketing::ONLINE_STATUS_QIDONG;
$where += self::getStartEndTimeFilter(MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS);
$where['life_account_id'] = self::getPublicLifeAccountId();
$where['ORDER'] = ['end_time' => 'ASC','marketing_id'=>'ASC'];
$where['LIMIT'] = [0, $limit];
$list = Marketing::select(['marketing_id', 'marketing_name','start_time','end_time'], $where);
if(empty($list)) {
return [];
}
$list = array_column($list,null,'marketing_id');
//从列表中排除需要排除的活动
if($excludeMarketingId && isset($list[$excludeMarketingId])){
unset($list[$excludeMarketingId]);
}
//获取活动sku列表
if($needSkuList) {
$skuList = self::getGoodsSkuListByMarketingIds(array_keys($list),false);
foreach ($list as $marketingId => &$value) {
$value['sku_list'] = $skuList[$marketingId] ?? [];
}
unset($value);
}
$list = array_slice($list,0);
return $list;
}
/**
* 获取进行中和当天即将开始的活动列表
* @param int $page
* @param int $pageSize
* @return mixed
* @throws InterfaceException
*/
public static function getPindanActiveAndReadyList($page=1,$pageSize=50)
{
$params['page'] = $page;
$params['page_size'] = $pageSize;
$params['marketing_type'] = Marketing::MARKETING_TYPE_PINDAN;//1分销 2团购 3秒杀 4团餐
$params['online_status'] = Marketing::ONLINE_STATUS_QIDONG;//状态 , 1启用,2关闭,3 到期
$params['from'] = 1;//1 小程序前台 默认0 后台
//正在进行中的 按结束时间正序
$params['sort_field'] = 'end_time';
$params['sort_type'] = 'asc';
$params['need_buy_num'] = false;
$params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS;//1 未开始,2进行中,3已结束
$list['doing'] = self::marketingList($params)['result'];
$list['doing'] = $list['doing'] ? array_column($list['doing'], null, 'marketing_id') : [];
$marketingIdsDoing = array_keys($list['doing']);
//当天即将开始的 按开始时间正序
$params['page'] = 1;
$params['sort_field'] = 'start_time';
$params['sort_type'] = 'asc';
$params['need_buy_num'] = false;
$params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_START_TODAY;//1 未开始,2进行中,3已结束, 4当日上新(即将开始)
$list['prepare'] = self::marketingList($params)['result'];
$list['prepare'] = $list['prepare'] ? array_column((array)$list['prepare'], null, 'marketing_id') : [];
return self::_fillSkuAndOrderInfo($marketingIdsDoing,$list);
}
/**
* 获取已结束的拼单活动列表
* @param int $page
* @param int $pageSize
* @param bool $useCache
* @return array|mixed
*/
public static function getPindanEndList($page=1,$pageSize=10,$useCache=true){
try{
$redis = RedisUtil::getInstance('cache',['serializer'=>'none']);
$key = "tuancan_end_list_".$page.'_'.$pageSize.'_'.date('Ymd');
$list = $useCache ? $redis->get($key) : [];
if(empty($list)) {
//已结束的 按结束时间倒序
$params['page'] = $page;
$params['page_size'] = $pageSize;
$params['marketing_type'] = Marketing::MARKETING_TYPE_PINDAN;//1分销 2团购 3秒杀 4团餐
$params['from'] = 1;//1 小程序前台 默认0 后台
$params['sort_field'] = 'end_time';
$params['sort_type'] = 'desc';
$params['need_buy_num'] = false;
$params['online_status'] = [Marketing::ONLINE_STATUS_QIDONG, Marketing::ONLINE_STATUS_GUANBI, Marketing::ONLINE_STATUS_DAOQI];//状态 , 1启用,2关闭,3 到期
$params['activity_status'] = MarketingPindan::ACTIVITY_STATUS_FINISHED;//1 未开始,2进行中,3已结束, 4当日上新(即将开始)
$list = MarketingService::marketingList($params)['result'];
$list = $list ? array_column($list, null, 'marketing_id') : [];
$marketingIdsEnd = array_keys($list);
$list = self::_fillSkuAndOrderInfo($marketingIdsEnd,['end'=>$list]);
$redis->set($key,json_encode($list),['ex'=>86400]);//已结束列表 缓存一天
}else {
$list = json_decode($list, true);
}
}catch (\Exception $e) {
FileLog::error("获取团餐已结束列表异常", $e->getMessage(), $e, 'suntengda@yidian-inc.com');
}
return $list ?? [];
}
/**
* 给列表填充sku和订单相关信息
* @param $marketingIds
* @param $list
* @return mixed
* @throws \App\Exception\custom\InterfaceException
*/
private static function _fillSkuAndOrderInfo($marketingIds,$list) {
//获取活动的sku列表
$skuList = self::getGoodsSkuListByMarketingIds($marketingIds);
//并行调用order统计接口
//获取活动支付用户列表
$urls['order_user'] = config('interface', 'order.marketing.marketing_user');
//获取活动支付用户数
$urls['buy_num'] = config('interface', 'order.order.have_buy_goods_user_count');
$params['order_user'] = $params['buy_num'] = ['marketing_id' => $marketingIds];
$encryptRes = HttpUtil::concurrencyPost($urls, $params);
if (!empty($encryptRes)) {
foreach ($encryptRes as $key => $item) {
if (!empty($item["response"])) {
$data[$key] = $item['response']['result'];
}
}
}
//组合sku和order信息
foreach ($list as &$listPart) {
foreach ($listPart as $marketingId => &$value) {
$value['sku_list'] = $skuList[$marketingId] ?? [];
$value['order_user'] = $data['order_user'][$marketingId] ?? [];
$value['participate_number'] = $data['buy_num'][$marketingId] ?? 0;
}
unset($value);
$listPart = array_values($listPart);
}
unset($listPart);
return $list;
}
/** /**
* 创建活动 * 创建活动
* @param $params * @param $params
...@@ -1205,24 +1390,34 @@ class MarketingService ...@@ -1205,24 +1390,34 @@ class MarketingService
/** /**
* 获取多个活动的商品列表 * 获取多个活动的商品列表
* @param $marketingIds * @param $marketingIds
* @param bool $needSoldNum
* @return array * @return array
* @throws InterfaceException * @throws InterfaceException
*/ */
public static function getGoodsSkuListByMarketingIds($marketingIds) public static function getGoodsSkuListByMarketingIds($marketingIds,$needSoldNum=true)
{ {
$marketingGoodsList = MarketingGoods::marketingGoodsList(['marketing_id' => $marketingIds, "ORDER" => ["id" => "ASC"]]); $marketingGoodsList = MarketingGoods::marketingGoodsList(['marketing_id' => $marketingIds, "ORDER" => ["id" => "ASC"]]);
$goodsSkuList = []; $goodsSkuList = $picUrl =[];
if (!empty($marketingGoodsList)) { if (!empty($marketingGoodsList)) {
$goodsSkuId = array_column($marketingGoodsList , 'goods_sku_id'); $goodsSkuId = array_column($marketingGoodsList , 'goods_sku_id');
$goodsSkuList = PindanGoodsSku::select('*', ['goods_sku_id' => $goodsSkuId]); $goodsSkuList = PindanGoodsSku::select('*', ['goods_sku_id' => $goodsSkuId]);
$goodsSkuList = array_column((array)$goodsSkuList, null, "goods_sku_id"); $goodsSkuList = array_column((array)$goodsSkuList, null, "goods_sku_id");
$picIds = [];
if(!empty($goodsSkuList)) {
foreach ($goodsSkuList as $index => $item) {
$item['desc_pic_url'] = explode(',',$item['desc_pic_url']) ?: [];
$picIds = array_merge($picIds,$item['desc_pic_url']);
}
$picUrl = Ks3Api::concurrencyPicEncryptUrl($picIds);
}
} }
$list = []; $list = [];
if (!empty($goodsSkuList)) { if (!empty($goodsSkuList)) {
//活动sku购买数量 //活动sku购买数量
$soldNum = self::getHaveBuyGoodsStatistics(["marketing_id" => $marketingIds]); $needSoldNum && $soldNum = self::getHaveBuyGoodsStatistics(["marketing_id" => $marketingIds]);
//保持排序 //保持排序
foreach ($marketingGoodsList as $key => $value) { foreach ($marketingGoodsList as $key => $value) {
...@@ -1232,10 +1427,13 @@ class MarketingService ...@@ -1232,10 +1427,13 @@ class MarketingService
$list[$value['marketing_id']][$key] = $value; $list[$value['marketing_id']][$key] = $value;
$item = $goodsSkuList[$value["goods_sku_id"]]; $item = $goodsSkuList[$value["goods_sku_id"]];
$list[$value['marketing_id']][$key]['goods_name'] = $item['goods_name']; $list[$value['marketing_id']][$key]['goods_name'] = $item['goods_name'];
$list[$value['marketing_id']][$key]["desc_pic_url_list"] = GoodsService::getUrlList($item["desc_pic_url"]);
foreach ($goodsSkuList[$value["goods_sku_id"]]['desc_pic_url'] as $picId) {
$list[$value['marketing_id']][$key]["desc_pic_url_list"][] = $picUrl[$picId];
}
$list[$value['marketing_id']][$key]["original_price"] = empty($item["original_price"]) ? '' : sprintf("%.2f", (int)$item["original_price"] / 100); $list[$value['marketing_id']][$key]["original_price"] = empty($item["original_price"]) ? '' : sprintf("%.2f", (int)$item["original_price"] / 100);
$list[$value['marketing_id']][$key]["price"] = sprintf("%.2f", $item["price"] / 100); $list[$value['marketing_id']][$key]["price"] = sprintf("%.2f", $item["price"] / 100);
$list[$value['marketing_id']][$key]["all_have_buy_goods_count"] = $soldNum[$value["goods_sku_id"]] ?? 0; $needSoldNum && $list[$value['marketing_id']][$key]["all_have_buy_goods_count"] = $soldNum[$value["goods_sku_id"]] ?? 0;
$list[$value['marketing_id']][$key]['inventory_rest'] = $item['inventory_rest']; $list[$value['marketing_id']][$key]['inventory_rest'] = $item['inventory_rest'];
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"require": { "require": {
"php": "7.2.*", "php": "7.2.*",
"ext-json": "*", "ext-json": "*",
"api/php_services":"1.0.15", "api/php_services":"1.0.16",
"api/php_utils":"1.0.17", "api/php_utils":"1.0.17",
"ext-openssl": "*" "ext-openssl": "*"
}, },
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b64691cd0b568f54f381382cdb77553b", "content-hash": "a6ce79abff3778226d347be8c1ba2b8b",
"packages": [ "packages": [
{ {
"name": "api/php_services", "name": "api/php_services",
"version": "1.0.15", "version": "1.0.16",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git", "url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "590b209014d0ccb8de96dd4cb243eeee41cae47d" "reference": "ea80bdaefe875350b425b0aee11f59bf45d7258d"
}, },
"require": { "require": {
"endroid/qr-code": "^3.9", "endroid/qr-code": "^3.9",
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
} }
}, },
"description": "bp api php_services", "description": "bp api php_services",
"time": "2021-09-14T06:43:42+00:00" "time": "2021-09-15T02:17:53+00:00"
}, },
{ {
"name": "api/php_utils", "name": "api/php_utils",
...@@ -67,13 +67,7 @@ ...@@ -67,13 +67,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f73543ac4e1def05f1a70bcd1525c8a157a1ad09", "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f73543ac4e1def05f1a70bcd1525c8a157a1ad09",
"reference": "f73543ac4e1def05f1a70bcd1525c8a157a1ad09", "reference": "f73543ac4e1def05f1a70bcd1525c8a157a1ad09",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"dasprid/enum": "^1.0.3", "dasprid/enum": "^1.0.3",
...@@ -126,13 +120,7 @@ ...@@ -126,13 +120,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2", "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2",
"reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2", "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7 | ^8 | ^9", "phpunit/phpunit": "^7 | ^8 | ^9",
...@@ -179,13 +167,7 @@ ...@@ -179,13 +167,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/8d08050fef9d89004702b1428b8c1f7f4f6162cf", "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/8d08050fef9d89004702b1428b8c1f7f4f6162cf",
"reference": "8d08050fef9d89004702b1428b8c1f7f4f6162cf", "reference": "8d08050fef9d89004702b1428b8c1f7f4f6162cf",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-json": ">=1.3.7", "ext-json": ">=1.3.7",
...@@ -254,13 +236,7 @@ ...@@ -254,13 +236,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/9cdd4f5d609bfc8811ca4a62b4d23eb16976242f", "url": "https://api.github.com/repos/endroid/qr-code/zipball/9cdd4f5d609bfc8811ca4a62b4d23eb16976242f",
"reference": "9cdd4f5d609bfc8811ca4a62b4d23eb16976242f", "reference": "9cdd4f5d609bfc8811ca4a62b4d23eb16976242f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"bacon/bacon-qr-code": "^2.0", "bacon/bacon-qr-code": "^2.0",
...@@ -335,13 +311,7 @@ ...@@ -335,13 +311,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ezimuel/guzzlestreams/zipball/abe3791d231167f14eb80d413420d1eab91163a8", "url": "https://api.github.com/repos/ezimuel/guzzlestreams/zipball/abe3791d231167f14eb80d413420d1eab91163a8",
"reference": "abe3791d231167f14eb80d413420d1eab91163a8", "reference": "abe3791d231167f14eb80d413420d1eab91163a8",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0"
...@@ -395,13 +365,7 @@ ...@@ -395,13 +365,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ezimuel/ringphp/zipball/0b78f89d8e0bb9e380046c31adfa40347e9f663b", "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/0b78f89d8e0bb9e380046c31adfa40347e9f663b",
"reference": "0b78f89d8e0bb9e380046c31adfa40347e9f663b", "reference": "0b78f89d8e0bb9e380046c31adfa40347e9f663b",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ezimuel/guzzlestreams": "^3.0.1", "ezimuel/guzzlestreams": "^3.0.1",
...@@ -456,13 +420,7 @@ ...@@ -456,13 +420,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"guzzlehttp/promises": "^1.0", "guzzlehttp/promises": "^1.0",
...@@ -531,13 +489,7 @@ ...@@ -531,13 +489,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa", "url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa", "reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
...@@ -622,13 +574,7 @@ ...@@ -622,13 +574,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f", "url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f",
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f", "reference": "9d006741ba865a45adccfac45d8e1053086a5a3f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
...@@ -724,13 +670,7 @@ ...@@ -724,13 +670,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/04fdd58d86a387065f707dc6d3cc304c719910c1", "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/04fdd58d86a387065f707dc6d3cc304c719910c1",
"reference": "04fdd58d86a387065f707dc6d3cc304c719910c1", "reference": "04fdd58d86a387065f707dc6d3cc304c719910c1",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.6" "php": ">=5.6"
...@@ -785,13 +725,7 @@ ...@@ -785,13 +725,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/18fca8cc8d0c2cc07f76605760d20632bb3dab96", "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/18fca8cc8d0c2cc07f76605760d20632bb3dab96",
"reference": "18fca8cc8d0c2cc07f76605760d20632bb3dab96", "reference": "18fca8cc8d0c2cc07f76605760d20632bb3dab96",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-hash": "*", "ext-hash": "*",
...@@ -855,13 +789,7 @@ ...@@ -855,13 +789,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7", "reference": "d178027d1e679832db9f38248fcc7200647dc2b7",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
...@@ -921,13 +849,7 @@ ...@@ -921,13 +849,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/perftools/php-profiler/zipball/794c435f615ab9ca4347e386b4d8c6524fe9e3ae", "url": "https://api.github.com/repos/perftools/php-profiler/zipball/794c435f615ab9ca4347e386b4d8c6524fe9e3ae",
"reference": "794c435f615ab9ca4347e386b4d8c6524fe9e3ae", "reference": "794c435f615ab9ca4347e386b4d8c6524fe9e3ae",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
...@@ -989,13 +911,7 @@ ...@@ -989,13 +911,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/efd67d1dc14a7ef4fc4e518e7dee91c271d524e4", "url": "https://api.github.com/repos/php-fig/http-message/zipball/efd67d1dc14a7ef4fc4e518e7dee91c271d524e4",
"reference": "efd67d1dc14a7ef4fc4e518e7dee91c271d524e4", "reference": "efd67d1dc14a7ef4fc4e518e7dee91c271d524e4",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -1049,13 +965,7 @@ ...@@ -1049,13 +965,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11", "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -1105,13 +1015,7 @@ ...@@ -1105,13 +1015,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
"reference": "120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.6" "php": ">=5.6"
...@@ -1155,13 +1059,7 @@ ...@@ -1155,13 +1059,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/reactphp/promise/zipball/a9752a861e21c0fe0b380c9f9e55beddc0ed7d31", "url": "https://api.github.com/repos/reactphp/promise/zipball/a9752a861e21c0fe0b380c9f9e55beddc0ed7d31",
"reference": "a9752a861e21c0fe0b380c9f9e55beddc0ed7d31", "reference": "a9752a861e21c0fe0b380c9f9e55beddc0ed7d31",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0"
...@@ -1221,13 +1119,7 @@ ...@@ -1221,13 +1119,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1295,13 +1187,7 @@ ...@@ -1295,13 +1187,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/cd63dbab0428a47f8576e4e58148aeae2e32e91c", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cd63dbab0428a47f8576e4e58148aeae2e32e91c",
"reference": "cd63dbab0428a47f8576e4e58148aeae2e32e91c", "reference": "cd63dbab0428a47f8576e4e58148aeae2e32e91c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
...@@ -1364,19 +1250,13 @@ ...@@ -1364,19 +1250,13 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" "reference": "f24ae462b1d60c333df104f0b81ec7d0e12f6e9f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f24ae462b1d60c333df104f0b81ec7d0e12f6e9f",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "reference": "f24ae462b1d60c333df104f0b81ec7d0e12f6e9f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1426,7 +1306,7 @@ ...@@ -1426,7 +1306,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" "source": "https://github.com/symfony/polyfill-ctype/tree/main"
}, },
"funding": [ "funding": [
{ {
...@@ -1442,7 +1322,7 @@ ...@@ -1442,7 +1322,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-19T12:13:01+00:00" "time": "2021-09-14T14:02:44+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-grapheme", "name": "symfony/polyfill-intl-grapheme",
...@@ -1456,13 +1336,7 @@ ...@@ -1456,13 +1336,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1544,13 +1418,7 @@ ...@@ -1544,13 +1418,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
"reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1635,13 +1503,7 @@ ...@@ -1635,13 +1503,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/344e456152e22a1bce3048c6c311059ea14bde47", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/344e456152e22a1bce3048c6c311059ea14bde47",
"reference": "344e456152e22a1bce3048c6c311059ea14bde47", "reference": "344e456152e22a1bce3048c6c311059ea14bde47",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1722,13 +1584,7 @@ ...@@ -1722,13 +1584,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
"reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1808,13 +1664,7 @@ ...@@ -1808,13 +1664,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1898,13 +1748,7 @@ ...@@ -1898,13 +1748,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/bd3efa2a2d856d167dde8e7b883c65119064b7f5", "url": "https://api.github.com/repos/symfony/property-access/zipball/bd3efa2a2d856d167dde8e7b883c65119064b7f5",
"reference": "bd3efa2a2d856d167dde8e7b883c65119064b7f5", "reference": "bd3efa2a2d856d167dde8e7b883c65119064b7f5",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
...@@ -1985,13 +1829,7 @@ ...@@ -1985,13 +1829,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/903f3f3f6a360bc4739f8390e5031acc70d9cd9f", "url": "https://api.github.com/repos/symfony/property-info/zipball/903f3f3f6a360bc4739f8390e5031acc70d9cd9f",
"reference": "903f3f3f6a360bc4739f8390e5031acc70d9cd9f", "reference": "903f3f3f6a360bc4739f8390e5031acc70d9cd9f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
...@@ -2081,13 +1919,7 @@ ...@@ -2081,13 +1919,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b", "url": "https://api.github.com/repos/symfony/string/zipball/fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b",
"reference": "fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b", "reference": "fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
......
...@@ -180,4 +180,61 @@ class Ks3Api ...@@ -180,4 +180,61 @@ class Ks3Api
list($msec, $sec) = explode(' ', microtime()); list($msec, $sec) = explode(' ', microtime());
return (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000); return (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
} }
/**
* 批量获取图片
* @param $imageIds image_id 数组
* @param int $widthSize
* @param int $highSize
* @param float|int $expirationTime
* @return array
*/
public static function concurrencyPicEncryptUrl($imageIds, $widthSize = 0, $highSize = 0, $expirationTime = 60 * 60 * 24 * 365)
{
$url = self::BASE_GEN_URL . self::PATH_PIC_ENCRYPT_URL;
$timestamp = self::msectime();
$extend = [];
$extend["expiration_time"] = $expirationTime;
if (!empty($widthSize) && !empty($highSize)) {
$extend["query"] = "type=thumbnail_" . $widthSize . "x" . $highSize;
}
$extendJsonStr = json_encode($extend);
$params = [];
$urls = [];
foreach ($imageIds as $imageId) {
$md5Str = $extendJsonStr . "&" . $imageId . "&" . self::AUDIT_ID . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
$contentType = 'multipart/form-data';
$param = [
"image_id" => $imageId,
"auth_id" => self::AUDIT_ID,
"timestamp" => $timestamp,
"signature" => $signature,
"content_type" => $contentType,
"extend" => $extendJsonStr,
];
$params[$imageId] = $param;
$urls[$imageId] = $url;
}
$data = [];
if (!empty($urls)) {
$begin = microtime(true);
$encryptRes = HttpUtil::concurrencyPost($urls, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
$resCode = $encryptRes["response"]['code'] === 0 ? 200 : $encryptRes["response"]['code'];
MonUtil::proxyMon($url, $resCode, 'ks3api', $totalTime);
if (!empty($encryptRes)) {
foreach ($encryptRes as $imageId => $item) {
if (!empty($item["response"]["data"]["url"])) {
$data[$imageId] = $item["response"]["data"]["url"];
}
}
}
}
return $data;
}
} }
\ No newline at end of file
...@@ -8,18 +8,18 @@ $baseDir = dirname($vendorDir); ...@@ -8,18 +8,18 @@ $baseDir = dirname($vendorDir);
return array( return array(
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php', 'a9ed0d27b5a698798a89181429f162c5' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'3a37ebac017bc098e9a86b35401e7a68' => $vendorDir . '/mongodb/mongodb/src/functions.php', '3a37ebac017bc098e9a86b35401e7a68' => $vendorDir . '/mongodb/mongodb/src/functions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
); );
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
"packages": [ "packages": [
{ {
"name": "api/php_services", "name": "api/php_services",
"version": "1.0.14", "version": "1.0.16",
"version_normalized": "1.0.14.0", "version_normalized": "1.0.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git", "url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "f2ba54cfaff45ffa8c0c4864f3b4935e1fcb3cfa" "reference": "ea80bdaefe875350b425b0aee11f59bf45d7258d"
}, },
"require": { "require": {
"endroid/qr-code": "^3.9", "endroid/qr-code": "^3.9",
"perftools/php-profiler": "^0.18.0", "perftools/php-profiler": "^0.18.0",
"php": "7.2.*" "php": "7.2.*"
}, },
"time": "2021-09-08T06:38:07+00:00", "time": "2021-09-15T02:17:53+00:00",
"type": "library", "type": "library",
"installation-source": "source", "installation-source": "source",
"autoload": { "autoload": {
...@@ -553,7 +553,13 @@ ...@@ -553,7 +553,13 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa", "url": "https://api.github.com/repos/guzzle/promises/zipball/c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa", "reference": "c1dd809c8f51a477701052f4b9e5b4bb5c1061aa",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
...@@ -641,7 +647,13 @@ ...@@ -641,7 +647,13 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f", "url": "https://api.github.com/repos/guzzle/psr7/zipball/9d006741ba865a45adccfac45d8e1053086a5a3f",
"reference": "9d006741ba865a45adccfac45d8e1053086a5a3f", "reference": "9d006741ba865a45adccfac45d8e1053086a5a3f",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
...@@ -1332,14 +1344,12 @@ ...@@ -1332,14 +1344,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "f1b99f10ea04aa9d0aafddcd8ba3d65545403bab" "reference": "cd63dbab0428a47f8576e4e58148aeae2e32e91c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/cd63dbab0428a47f8576e4e58148aeae2e32e91c",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/4b78e55b179003a42523a362cc0e8327f7a69b5e", "reference": "cd63dbab0428a47f8576e4e58148aeae2e32e91c",
"reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1354,7 +1364,7 @@ ...@@ -1354,7 +1364,7 @@
"symfony/polyfill-php73": "~1.0", "symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.16" "symfony/polyfill-php80": "^1.16"
}, },
"time": "2021-08-17T14:20:01+00:00", "time": "2021-09-09T08:06:01+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
...@@ -1412,19 +1422,13 @@ ...@@ -1412,19 +1422,13 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" "reference": "f24ae462b1d60c333df104f0b81ec7d0e12f6e9f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f24ae462b1d60c333df104f0b81ec7d0e12f6e9f",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "reference": "f24ae462b1d60c333df104f0b81ec7d0e12f6e9f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
...@@ -1432,7 +1436,7 @@ ...@@ -1432,7 +1436,7 @@
"suggest": { "suggest": {
"ext-ctype": "For best performance" "ext-ctype": "For best performance"
}, },
"time": "2021-02-19T12:13:01+00:00", "time": "2021-09-14T14:02:44+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1476,7 +1480,7 @@ ...@@ -1476,7 +1480,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" "source": "https://github.com/symfony/polyfill-ctype/tree/main"
}, },
"funding": [ "funding": [
{ {
...@@ -1686,12 +1690,12 @@ ...@@ -1686,12 +1690,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" "reference": "344e456152e22a1bce3048c6c311059ea14bde47"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/344e456152e22a1bce3048c6c311059ea14bde47",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "reference": "344e456152e22a1bce3048c6c311059ea14bde47",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1706,7 +1710,7 @@ ...@@ -1706,7 +1710,7 @@
"suggest": { "suggest": {
"ext-mbstring": "For best performance" "ext-mbstring": "For best performance"
}, },
"time": "2021-05-27T12:26:48+00:00", "time": "2021-09-13T13:54:24+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1751,7 +1755,7 @@ ...@@ -1751,7 +1755,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" "source": "https://github.com/symfony/polyfill-mbstring/tree/main"
}, },
"funding": [ "funding": [
{ {
...@@ -1776,12 +1780,12 @@ ...@@ -1776,12 +1780,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php73.git", "url": "https://github.com/symfony/polyfill-php73.git",
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1793,7 +1797,7 @@ ...@@ -1793,7 +1797,7 @@
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
}, },
"time": "2021-02-19T12:13:01+00:00", "time": "2021-06-05T21:20:04+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1840,7 +1844,7 @@ ...@@ -1840,7 +1844,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" "source": "https://github.com/symfony/polyfill-php73/tree/main"
}, },
"funding": [ "funding": [
{ {
...@@ -1865,12 +1869,12 @@ ...@@ -1865,12 +1869,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php80.git", "url": "https://github.com/symfony/polyfill-php80.git",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1882,7 +1886,7 @@ ...@@ -1882,7 +1886,7 @@
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
}, },
"time": "2021-07-28T13:41:28+00:00", "time": "2021-09-13T13:58:33+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1933,7 +1937,7 @@ ...@@ -1933,7 +1937,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" "source": "https://github.com/symfony/polyfill-php80/tree/main"
}, },
"funding": [ "funding": [
{ {
...@@ -1958,13 +1962,12 @@ ...@@ -1958,13 +1962,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/property-access.git", "url": "https://github.com/symfony/property-access.git",
"reference": "7831b0331b786db39026d190faa4914f94adb212" "reference": "bd3efa2a2d856d167dde8e7b883c65119064b7f5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/aaa09eb714623e935494b5852c1eff260b704ae1", "url": "https://api.github.com/repos/symfony/property-access/zipball/bd3efa2a2d856d167dde8e7b883c65119064b7f5",
"reference": "aaa09eb714623e935494b5852c1eff260b704ae1", "reference": "bd3efa2a2d856d167dde8e7b883c65119064b7f5",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1985,7 +1988,7 @@ ...@@ -1985,7 +1988,7 @@
"suggest": { "suggest": {
"psr/cache-implementation": "To cache access methods." "psr/cache-implementation": "To cache access methods."
}, },
"time": "2021-08-17T14:20:01+00:00", "time": "2021-09-10T12:30:46+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
...@@ -2049,13 +2052,12 @@ ...@@ -2049,13 +2052,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/property-info.git", "url": "https://github.com/symfony/property-info.git",
"reference": "3565216f9640b26b646855e39e7bfafc550c75db" "reference": "903f3f3f6a360bc4739f8390e5031acc70d9cd9f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/63eddb6d10fffe3f25d901d78fef37ca88838b22", "url": "https://api.github.com/repos/symfony/property-info/zipball/903f3f3f6a360bc4739f8390e5031acc70d9cd9f",
"reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22", "reference": "903f3f3f6a360bc4739f8390e5031acc70d9cd9f",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -2088,7 +2090,7 @@ ...@@ -2088,7 +2090,7 @@
"symfony/doctrine-bridge": "To use Doctrine metadata", "symfony/doctrine-bridge": "To use Doctrine metadata",
"symfony/serializer": "To use Serializer metadata" "symfony/serializer": "To use Serializer metadata"
}, },
"time": "2021-08-23T12:58:54+00:00", "time": "2021-09-07T15:45:17+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
...@@ -2155,7 +2157,13 @@ ...@@ -2155,7 +2157,13 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b", "url": "https://api.github.com/repos/symfony/string/zipball/fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b",
"reference": "fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b", "reference": "fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
......
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '2af24ef59d9888a3a8c64df2ea4efd62c8a675a1', 'reference' => '40f8b230881d7a86438dc069837b93af2d6b8b73',
'name' => 'yidian/yaf_demo', 'name' => 'yidian/yaf_demo',
'dev' => true, 'dev' => true,
), ),
'versions' => array( 'versions' => array(
'api/php_services' => array( 'api/php_services' => array(
'pretty_version' => '1.0.15', 'pretty_version' => '1.0.16',
'version' => '1.0.15.0', 'version' => '1.0.16.0',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../api/php_services', 'install_path' => __DIR__ . '/../api/php_services',
'aliases' => array(), 'aliases' => array(),
'reference' => '590b209014d0ccb8de96dd4cb243eeee41cae47d', 'reference' => 'ea80bdaefe875350b425b0aee11f59bf45d7258d',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'api/php_utils' => array( 'api/php_utils' => array(
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
'aliases' => array( 'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', 'reference' => 'f24ae462b1d60c333df104f0b81ec7d0e12f6e9f',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'symfony/polyfill-intl-grapheme' => array( 'symfony/polyfill-intl-grapheme' => array(
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '2af24ef59d9888a3a8c64df2ea4efd62c8a675a1', 'reference' => '40f8b230881d7a86438dc069837b93af2d6b8b73',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
), ),
......
...@@ -25,13 +25,13 @@ final class Ctype ...@@ -25,13 +25,13 @@ final class Ctype
* *
* @see https://php.net/ctype-alnum * @see https://php.net/ctype-alnum
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_alnum($text) public static function ctype_alnum($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
} }
...@@ -41,13 +41,13 @@ final class Ctype ...@@ -41,13 +41,13 @@ final class Ctype
* *
* @see https://php.net/ctype-alpha * @see https://php.net/ctype-alpha
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_alpha($text) public static function ctype_alpha($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
} }
...@@ -57,13 +57,13 @@ final class Ctype ...@@ -57,13 +57,13 @@ final class Ctype
* *
* @see https://php.net/ctype-cntrl * @see https://php.net/ctype-cntrl
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_cntrl($text) public static function ctype_cntrl($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
} }
...@@ -73,13 +73,13 @@ final class Ctype ...@@ -73,13 +73,13 @@ final class Ctype
* *
* @see https://php.net/ctype-digit * @see https://php.net/ctype-digit
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_digit($text) public static function ctype_digit($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
} }
...@@ -89,13 +89,13 @@ final class Ctype ...@@ -89,13 +89,13 @@ final class Ctype
* *
* @see https://php.net/ctype-graph * @see https://php.net/ctype-graph
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_graph($text) public static function ctype_graph($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
} }
...@@ -105,13 +105,13 @@ final class Ctype ...@@ -105,13 +105,13 @@ final class Ctype
* *
* @see https://php.net/ctype-lower * @see https://php.net/ctype-lower
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_lower($text) public static function ctype_lower($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
} }
...@@ -121,13 +121,13 @@ final class Ctype ...@@ -121,13 +121,13 @@ final class Ctype
* *
* @see https://php.net/ctype-print * @see https://php.net/ctype-print
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_print($text) public static function ctype_print($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
} }
...@@ -137,13 +137,13 @@ final class Ctype ...@@ -137,13 +137,13 @@ final class Ctype
* *
* @see https://php.net/ctype-punct * @see https://php.net/ctype-punct
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_punct($text) public static function ctype_punct($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
} }
...@@ -153,13 +153,13 @@ final class Ctype ...@@ -153,13 +153,13 @@ final class Ctype
* *
* @see https://php.net/ctype-space * @see https://php.net/ctype-space
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_space($text) public static function ctype_space($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
} }
...@@ -169,13 +169,13 @@ final class Ctype ...@@ -169,13 +169,13 @@ final class Ctype
* *
* @see https://php.net/ctype-upper * @see https://php.net/ctype-upper
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_upper($text) public static function ctype_upper($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
} }
...@@ -185,13 +185,13 @@ final class Ctype ...@@ -185,13 +185,13 @@ final class Ctype
* *
* @see https://php.net/ctype-xdigit * @see https://php.net/ctype-xdigit
* *
* @param string|int $text * @param mixed $text
* *
* @return bool * @return bool
*/ */
public static function ctype_xdigit($text) public static function ctype_xdigit($text)
{ {
$text = self::convert_int_to_char_for_ctype($text); $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
} }
...@@ -204,11 +204,12 @@ final class Ctype ...@@ -204,11 +204,12 @@ final class Ctype
* (negative values have 256 added in order to allow characters in the Extended ASCII range). * (negative values have 256 added in order to allow characters in the Extended ASCII range).
* Any other integer is interpreted as a string containing the decimal digits of the integer. * Any other integer is interpreted as a string containing the decimal digits of the integer.
* *
* @param string|int $int * @param mixed $int
* @param string $function
* *
* @return mixed * @return mixed
*/ */
private static function convert_int_to_char_for_ctype($int) private static function convert_int_to_char_for_ctype($int, $function)
{ {
if (!\is_int($int)) { if (!\is_int($int)) {
return $int; return $int;
...@@ -218,6 +219,10 @@ final class Ctype ...@@ -218,6 +219,10 @@ final class Ctype
return (string) $int; return (string) $int;
} }
if (\PHP_VERSION_ID >= 80100) {
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
}
if ($int < 0) { if ($int < 0) {
$int += 256; $int += 256;
} }
......
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