- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
66 lines
1.6 KiB
PHP
66 lines
1.6 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\jobs\activity\card;
|
|
|
|
|
|
use app\services\activity\card\CardBatchServices;
|
|
use app\services\activity\card\CardCodeServices;
|
|
use app\services\activity\card\CardGiftServices;
|
|
use app\services\activity\coupon\StoreCouponIssueServices;
|
|
use crmeb\basic\BaseJobs;
|
|
use crmeb\traits\QueueTrait;
|
|
|
|
/**
|
|
* 营销:礼品卡
|
|
* Class CardJob
|
|
* @package app\jobs\user
|
|
*/
|
|
class CardJob extends BaseJobs
|
|
{
|
|
|
|
use QueueTrait;
|
|
|
|
/**
|
|
* 卡密分配数量矫正
|
|
* @param $id
|
|
* @return bool
|
|
*/
|
|
public function allocationCode($id)
|
|
{
|
|
try {
|
|
app()->make(CardBatchServices::class)->allocationCode($id);
|
|
} catch (\Throwable $e) {
|
|
response_log_write([
|
|
'message' => '卡密分配数量统计失败:' . $e->getMessage(),
|
|
'file' => $e->getFile(),
|
|
'line' => $e->getLine()
|
|
]);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* 校验使用数量
|
|
* @param $id
|
|
* @return true
|
|
* User: liusl
|
|
* DateTime: 2025/5/24 10:57
|
|
*/
|
|
public function allocationCardGift($id)
|
|
{
|
|
try {
|
|
app()->make(CardGiftServices::class)->allocationCardGift($id);
|
|
} catch (\Throwable $e) {
|
|
response_log_write([
|
|
'message' => '卡密分配数量统计失败:' . $e->getMessage(),
|
|
'file' => $e->getFile(),
|
|
'line' => $e->getLine()
|
|
]);
|
|
}
|
|
return true;
|
|
}
|
|
}
|