Browse Source

库存、定时任务

master
weigang 5 years ago
parent
commit
ebb8151376
  1. 5
      app/Controller/v3/OrderOnlineController.php
  2. 25
      app/Crontab/AutoCancelOrder.php
  3. 12
      app/Service/v3/Implementations/GoodsActivityService.php
  4. 11
      app/Service/v3/Implementations/GoodsService.php
  5. 4
      app/Service/v3/Implementations/LocationService.php
  6. 20
      app/Service/v3/Implementations/OrderListService.php
  7. 65
      app/Service/v3/Implementations/OrderOnlineService.php
  8. 6
      app/Service/v3/Interfaces/OrderOnlineServiceInterface.php
  9. 3
      composer.json
  10. 559
      composer.lock
  11. 5
      config/autoload/crontab.php
  12. 1
      config/autoload/dependencies.php
  13. 1
      config/autoload/processes.php

5
app/Controller/v3/OrderOnlineController.php

@ -129,7 +129,10 @@ class OrderOnlineController extends BaseController
$res['store_list'] = $this->shopCartService->getGoodsByShopcartId($shopcartIds);
//获取用户优惠券
$coupons = $this->couponRecService->allForOnlineOrderAvailable($userId, $marketId);
$res['coupon'] = [];
$res['coupon'] = [
'available' => [],
'not_available' => [],
];
foreach ($coupons as $key => &$item) {
foreach ($item as $k => &$rec) {
for ($i=0; $i<$rec->number_remain; $i++) {

25
app/Crontab/AutoCancelOrder.php

@ -0,0 +1,25 @@
<?php
namespace App\Crontab;
use App\Service\v3\Interfaces\OrderOnlineServiceInterface;
use Hyperf\Crontab\Annotation\Crontab;
use Hyperf\Di\Annotation\Inject;
/**
* @Crontab(name="autocancelorder", rule="*\/5 * * * * *", callback="execute", memo="自定取消15分钟过期订单")
*/
class AutoCancelOrder
{
/**
* @Inject
* @var OrderOnlineServiceInterface
*/
protected $orderOnlineService;
public function execute()
{
$this->orderOnlineService->autoCancel();
}
}

12
app/Service/v3/Implementations/GoodsActivityService.php

@ -49,20 +49,12 @@ class GoodsActivityService implements GoodsActivityServiceInterface
// 商品库存不足
// 获取冻结的库存
$inventoryFrozen = (int)$redis->get($inventoryKey);
// $inventoryFrozen = 0;
// $inventoryFrozen = (int)$redis->get($inventoryKey);
$inventoryFrozen = 0;
if($goods->is_infinite != 1 && $goods->inventory < ($num+$inventoryFrozen)){
return ErrorCode::GOODS_ACTIVITY_INVENTORY_ERROR;
}
// 压redis库存
// redis记录当前商品的购买数量,压库存,下单失败、下单成功扣库存成功、订单取消的时候释放
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, $num);
} else {
$redis->incrBy($inventoryKey, intval($num));
}
// 是否超过限购数量
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {
return ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT;

11
app/Service/v3/Implementations/GoodsService.php

@ -40,18 +40,11 @@ class GoodsService implements GoodsServiceInterface
}
// 商品库存不足
// 获取冻结的库存
$inventoryFrozen = (int)$redis->get($inventoryKey);
// $inventoryFrozen = 0;
// $inventoryFrozen = (int)$redis->get($inventoryKey);
$inventoryFrozen = 0;
if($goods->is_infinite != 1 && $goods->inventory < ($num+$inventoryFrozen)){
return ErrorCode::GOODS_INVENTORY_ERROR;
}
// 压redis库存
// redis记录当前商品的购买数量,压库存,下单失败、下单成功扣库存成功、订单取消的时候释放
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, $num);
} else {
$redis->incrBy($inventoryKey, intval($num));
}
// 是否超过限购数量
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {

4
app/Service/v3/Implementations/LocationService.php

@ -30,7 +30,7 @@ class LocationService implements LocationServiceInterface
public function getMarketListByLocation($lng,$lat)
{
$cityIds = Market::query()->pluck('city_id');
$cityIds = Market::query()->where(['status' => 1])->pluck('city_id');
$res = Area::query()->with('markets')->whereIn('id',$cityIds)->get();
foreach ($res as &$v){
@ -99,7 +99,7 @@ class LocationService implements LocationServiceInterface
public function getNearestMarket($lng,$lat)
{
$markets = Market::query()->get()->toArray();
$markets = Market::query()->where(['status' => 1])->get()->toArray();
$result = [];
$distinctMin = 0;
foreach ($markets as &$market){

20
app/Service/v3/Implementations/OrderListService.php

@ -8,6 +8,7 @@ use App\Model\v3\OrderMain;
use App\Model\v3\Order;
use App\Service\v3\Interfaces\BadgeServiceInterface;
use App\Service\v3\Interfaces\OrderListServiceInterface;
use App\Service\v3\Interfaces\OrderOnlineServiceInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Utils\ApplicationContext;
@ -20,6 +21,12 @@ class OrderListService implements OrderListServiceInterface
*/
protected $badgeService;
/**
* @Inject
* @var OrderOnlineServiceInterface
*/
protected $orderOnlineService;
public function do()
{
// TODO: Implement do() method.
@ -61,11 +68,6 @@ class OrderListService implements OrderListServiceInterface
// 清除badge
$this->badgeService->clearUserOrder($userId, $tab);
co(function () use ($userId) {
// 自动取消超时订单
$this->autoCancel($userId);
});
$paginate = $builder->orderBy('created_at', 'desc')->paginate($pagesize);
$orders = $paginate->toArray();
return ['has_more_pages' => $paginate->hasMorePages(), 'orders' => $orders['data'], 'note' => '待付款订单15分钟后将自动取消,请尽快支付!'];
@ -193,12 +195,4 @@ class OrderListService implements OrderListServiceInterface
$orders = $paginate->toArray();
return ['has_more_pages' => $paginate->hasMorePages(), 'orders' => $orders['data']];
}
public function autoCancel($userId)
{
return OrderMain::query()
->where(['user_id' => $userId, 'state' => OrderState::UNPAID])
->where('created_at', '<', time()-900)
->update(['state' => OrderState::CANCELED]);
}
}

65
app/Service/v3/Implementations/OrderOnlineService.php

@ -203,6 +203,15 @@ class OrderOnlineService implements OrderOnlineServiceInterface
}
// 压redis库存
// redis记录当前商品的购买数量,压库存,下单失败、下单成功扣库存成功、订单取消的时候释放
$inventoryKey = 'goods_inventory_sold_'.$cart->activity_type.'_'.$cart->goods_id; // 拼接activity_type和goods_id
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, $cart->num);
} else {
$redis->incrBy($inventoryKey, intval($cart->num));
}
// 算金额
$goodsAmount = bcmul((string)$goods->price, (string)$cart->num); # 当前商品的金额
$subAmount = bcadd((string)$subAmount, (string)$goodsAmount); # 当前店铺子订单的金额
@ -358,7 +367,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, 0);
} else {
$redis->decrBy($inventoryKey, $cart->num);
$redis->decrBy($inventoryKey, intval($cart->num));
}
}
$this->log->event(LogLabel::ORDER_ONLINE_LOG, ['msg' => $e->getMessage()]);
@ -425,7 +434,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, 0);
} else {
$redis->decrBy($inventoryKey, $goodsItem['number']);
$redis->decrBy($inventoryKey, intval($goodsItem['number']));
}
}
@ -520,7 +529,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, 0);
} else {
$redis->decrBy($inventoryKey, $goodsItem['number']);
$redis->decrBy($inventoryKey, intval($goodsItem['number']));
}
}
@ -635,4 +644,54 @@ class OrderOnlineService implements OrderOnlineServiceInterface
return $this->paymentService->undo($orderMain->global_order_id, $userId);
}
}
public function autoCancel()
{
$orderMains = OrderMain::query()
->select(['global_order_id', 'user_id'])
->where(['state' => OrderState::UNPAID])
->where('created_at', '<', time()-900)
->get();
foreach ($orderMains as $key => &$orderMain) {
// 订单待支付
$orderMain->state = OrderState::CANCELED;
if (!$orderMain->save()) {
throw new ErrorCodeException(ErrorCode::ORDER_NOT_AVAILABLE);
}
// 退还优惠券
$this->couponService->orderRefundCoupons($orderMain->global_order_id);
// 撤销活动商品购买记录
$orders = Order::query()->where(['order_main_id' => $orderMain->global_order_id])->get()->toArray();
$orderGoods = OrderGoods::query()
->whereIn('order_id', array_values(array_column($orders, 'id')))
->get()
->toArray();
foreach ($orderGoods as $key => &$goods) {
if ($goods['activity_type'] == 2) {
$this->goodsActivityService->clearCacheRecord($goods['goods_id'], $goods['number'], $orderMain->user_id);
}
}
// 释redis库存
$redis = ApplicationContext::getContainer()->get(Redis::class);
foreach ($orderGoods as $k => &$goodsItem) {
// 拼接activity_type和goods_id
$inventoryKey = 'goods_inventory_sold_'.$goodsItem['activity_type'].'_'.$goodsItem['goods_id'];
// redis记录当前商品的购买数量,压库存,下单失败、下单成功扣库存成功、订单取消的时候释放
if (!$redis->exists($inventoryKey)) {
$redis->set($inventoryKey, 0);
} else {
$redis->decrBy($inventoryKey, intval($goodsItem['number']));
}
}
// 记录badge
$orderChildIds = array_values(array_column($orders, 'store_id'));
$this->badgeService->doByOrder($orderMain->user_id, $orderChildIds, $orderMain->global_order_id, OrderState::CANCELED);
}
}
}

6
app/Service/v3/Interfaces/OrderOnlineServiceInterface.php

@ -70,4 +70,10 @@ interface OrderOnlineServiceInterface
* @return mixed
*/
public function doRefund($globalOrderId, $userId);
/**
* 自动取消订单
* @return mixed
*/
public function autoCancel();
}

3
composer.json

@ -42,7 +42,8 @@
"hyperf/rpc-client": "^2.0",
"hyperf/consul": "^2.0",
"alibabacloud/client": "^1.5",
"hashids/hashids": "^4.0"
"hashids/hashids": "^4.0",
"hyperf/crontab": "^2.0"
},
"require-dev": {
"swoole/ide-helper": "^4.5",

559
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9f238a6a5e556f4061e56600f28bacfd",
"content-hash": "7ab1eb814ce8a0d34cfec6c2c0725022",
"packages": [
{
"name": "adbario/php-dot-notation",
@ -522,6 +522,20 @@
"uppercase",
"words"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2020-05-29T07:19:59+00:00"
},
{
@ -584,6 +598,20 @@
"constructor",
"instantiate"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-05-29T17:27:14+00:00"
},
{
@ -652,6 +680,20 @@
"parser",
"php"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"type": "tidelift"
}
],
"time": "2020-05-25T17:44:05+00:00"
},
{
@ -1551,6 +1593,65 @@
],
"time": "2020-06-24T23:15:36+00:00"
},
{
"name": "hyperf/crontab",
"version": "v2.0.9",
"source": {
"type": "git",
"url": "https://github.com/hyperf/crontab.git",
"reference": "3167a34acdb53d19a12bce4a29139c6e51ed62a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hyperf/crontab/zipball/3167a34acdb53d19a12bce4a29139c6e51ed62a4",
"reference": "3167a34acdb53d19a12bce4a29139c6e51ed62a4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"hyperf/utils": "~2.0.0",
"nesbot/carbon": "^2.0",
"php": ">=7.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.9",
"malukenho/docheader": "^0.1.6",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
},
"hyperf": {
"config": "Hyperf\\Crontab\\ConfigProvider"
}
},
"autoload": {
"psr-4": {
"Hyperf\\Crontab\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A crontab component for Hyperf.",
"homepage": "https://hyperf.io",
"keywords": [
"crontab",
"hyperf",
"php",
"swoole"
],
"time": "2020-08-24T08:37:21+00:00"
},
{
"name": "hyperf/database",
"version": "v2.0.1",
@ -3771,6 +3872,12 @@
"laminas",
"zf"
],
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"time": "2020-05-20T16:45:56+00:00"
},
{
@ -4028,6 +4135,16 @@
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2020-05-22T08:12:19+00:00"
},
{
@ -4176,6 +4293,16 @@
"datetime",
"time"
],
"funding": [
{
"url": "https://opencollective.com/Carbon",
"type": "open_collective"
},
{
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
"type": "tidelift"
}
],
"time": "2020-07-04T12:29:56+00:00"
},
{
@ -4842,6 +4969,16 @@
"php",
"type"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2020-06-07T10:40:07+00:00"
},
{
@ -5880,6 +6017,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-15T12:59:21+00:00"
},
{
@ -5936,6 +6087,20 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-06T08:49:21+00:00"
},
{
@ -6014,6 +6179,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -6082,6 +6261,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
},
{
@ -6137,6 +6330,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -6286,6 +6493,20 @@
"polyfill",
"portable"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6356,6 +6577,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6433,6 +6668,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6506,6 +6755,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6575,6 +6838,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6644,6 +6921,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6709,6 +7000,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6777,6 +7082,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -6849,6 +7168,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -7289,6 +7622,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
},
{
@ -7366,6 +7713,20 @@
"utf-8",
"utf8"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-11T12:16:36+00:00"
},
{
@ -7450,6 +7811,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@ -7517,6 +7892,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
},
{
@ -7668,6 +8057,16 @@
"env",
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-07-14T19:22:52+00:00"
},
{
@ -7894,6 +8293,20 @@
"Xdebug",
"performance"
],
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2020-06-04T11:16:35+00:00"
},
{
@ -7982,6 +8395,20 @@
"redis",
"xcache"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"time": "2020-07-07T18:54:01+00:00"
},
{
@ -8053,6 +8480,20 @@
"iterators",
"php"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcollections",
"type": "tidelift"
}
],
"time": "2020-06-22T19:14:02+00:00"
},
{
@ -8142,6 +8583,20 @@
"doctrine",
"php"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon",
"type": "tidelift"
}
],
"time": "2020-06-05T16:46:05+00:00"
},
{
@ -8313,6 +8768,20 @@
"orm",
"persistence"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence",
"type": "tidelift"
}
],
"time": "2020-03-21T15:13:52+00:00"
},
{
@ -8494,6 +8963,12 @@
}
],
"description": "A tool to automatically fix PHP code style",
"funding": [
{
"url": "https://github.com/keradus",
"type": "github"
}
],
"time": "2020-06-27T23:57:46+00:00"
},
{
@ -8732,6 +9207,12 @@
"object",
"object graph"
],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2020-06-29T13:22:24+00:00"
},
{
@ -9020,6 +9501,20 @@
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://www.patreon.com/phpstan",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2020-07-01T11:57:52+00:00"
},
{
@ -10121,6 +10616,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@ -10183,6 +10692,20 @@
"configuration",
"options"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-23T13:08:13+00:00"
},
{
@ -10239,6 +10762,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@ -10295,6 +10832,20 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -10341,6 +10892,12 @@
}
],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"funding": [
{
"url": "https://github.com/theseer",
"type": "github"
}
],
"time": "2020-07-12T23:59:07+00:00"
}
],

5
config/autoload/crontab.php

@ -0,0 +1,5 @@
<?php
return [
// 是否开启定时任务
'enable' => true,
];

1
config/autoload/dependencies.php

@ -89,4 +89,5 @@ return [
\App\Service\v3\Interfaces\BadgeServiceInterface::class => \App\Service\v3\Implementations\BadgeService::class,
\App\Service\v3\Interfaces\InitialDeliveryServiceInterface::class => \App\Service\v3\Implementations\InitialDeliveryService::class,
\App\Service\v3\Interfaces\ServiceEvaluateServiceInterface::class => \App\Service\v3\Implementations\ServiceEvaluateService::class,
// \Hyperf\Crontab\Strategy\StrategyInterface::class => \Hyperf\Crontab\Strategy\TaskWorkerStrategy::class,
];

1
config/autoload/processes.php

@ -10,4 +10,5 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
return [
Hyperf\Crontab\Process\CrontabDispatcherProcess::class,
];
Loading…
Cancel
Save