| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Jobs;
- use App\Repositories\CreatorRepository;
- use Hyperf\AsyncQueue\Job;
- class AwardCreatorBuyVideoJob extends Job
- {
- protected $params = [];
- public function __construct($params = [])
- {
- $this->params = $params;
- }
- public function handle()
- {
- $videoId = $this->params['video_id'];
- $buyerUid = $this->params['buyer_uid'];
- $sellerUid = $this->params['seller_uid'] ?? '';
- $isDeduction = $this->params['is_deduction'] ?? 0; // 是否扣量
- $creatorRepo = make(CreatorRepository::class);
- $creatorRepo->handleAwardBuyVideo($videoId, $buyerUid);
- if (!empty($sellerUid)) {
- // 检查升级.
- $creatorRepo->checkAndUpgrade($sellerUid);
- }
- }
- }
|