feat: add channel code integral reward

This commit is contained in:
danaisuiyuan
2026-05-21 06:46:18 +08:00
parent ab65147b82
commit 673a19b3f7
8 changed files with 95 additions and 10 deletions

View File

@@ -1629,7 +1629,8 @@ class SystemConfigServices extends BaseServices implements ServeConfigInterface
$data = $this->getConfigAllField([
'integral_ratio_status', 'integral_ratio', 'integral_max_type', 'integral_max_num', 'integral_max_rate', 'order_give_integral', 'integral_effective_status',
'integral_effective_time', 'next_clear_month_time', 'next_clear_quarter_time', 'next_clear_year_time', 'integral_frozen'
'integral_effective_time', 'next_clear_month_time', 'next_clear_quarter_time', 'next_clear_year_time', 'integral_frozen',
'channel_code_integral_status', 'channel_code_agent_uid', 'channel_code_give_integral'
]);
/** @var UserIntegralServices $userIntergralServices */
@@ -1650,6 +1651,10 @@ class SystemConfigServices extends BaseServices implements ServeConfigInterface
])->options($this->getOptions($data['integral_max_type']['parameter']))
])->info($data['integral_ratio_status']['desc']),
Build::inputNum('order_give_integral', $data['order_give_integral']['info'], $data['order_give_integral']['value'])->info($data['order_give_integral']['desc'])->min(0),
Build::switch('channel_code_integral_status', $data['channel_code_integral_status']['info'], (int)$data['channel_code_integral_status']['value'])
->falseValue('关闭', 0)->trueValue('开启', 1)->info($data['channel_code_integral_status']['desc']),
Build::inputNum('channel_code_agent_uid', $data['channel_code_agent_uid']['info'], $data['channel_code_agent_uid']['value'])->info($data['channel_code_agent_uid']['desc'])->min(0),
Build::inputNum('channel_code_give_integral', $data['channel_code_give_integral']['info'], $data['channel_code_give_integral']['value'])->info($data['channel_code_give_integral']['desc'])->min(0),
Build::radio('integral_effective_status', $data['integral_effective_status']['info'], $data['integral_effective_status']['value'])
->info($data['integral_effective_status']['desc'])->control(1, [
Build::radio('integral_effective_time', $data['integral_effective_time']['info'], $data['integral_effective_time']['value'])

View File

@@ -20,7 +20,10 @@ class ClearServices extends BaseServices
*/
protected function delDirAndFile($dirName)
{
$list = glob($dirName . '*');
if (!is_dir($dirName)) {
return;
}
$list = glob($dirName . '*') ?: [];
foreach ($list as $file) {
if (is_dir($file))
$this->delDirAndFile($file . DS);

View File

@@ -135,6 +135,14 @@ class UserBillServices extends BaseServices
'status' => 1,
'pm' => 1
],
'channel_code_give_integral' => [
'title' => '渠道码赠送积分',
'category' => 'integral',
'type' => 'channel_code_add',
'mark' => '扫码渠道码赠送{%num%}积分',
'status' => 1,
'pm' => 1
],
'level_give_integral' => [
'title' => '会员卡激活赠送积分',
'category' => 'integral',

View File

@@ -376,7 +376,9 @@ class UserServices extends BaseServices
// 用户注册成功事件
$userInfo = array_merge($res->toArray(), [
'unionid' => $user['unionid'] ?? ''
'unionid' => $user['unionid'] ?? '',
'spread_qrcode_id' => (int)($user['spread_qrcode_id'] ?? 0),
'spread_qrcode_type' => $user['spread_qrcode_type'] ?? ''
]);
event('user.register', [$userInfo, true, $spreadUid]);

View File

@@ -275,6 +275,8 @@ class RoutineServices extends BaseServices
$info = $qrcode->get((int)$routine['spread_code']);
if ($info) {
$spread_uid = $info['third_id'];
$routineInfo['spread_qrcode_id'] = (int)$info['id'];
$routineInfo['spread_qrcode_type'] = $info['third_type'] ?? '';
}
}
return [$routine['openid'] ?? '', $routineInfo, $spread_uid, $routine['login_type'] ?? 'routine', 'routine'];