1、修复场景获客数据统计问题

2、修复默认头像破图问题
3、修复健康分展示问题
4、修复获客场景_好友迁移编辑会跳到其他类目问题
This commit is contained in:
wong
2025-12-24 15:27:57 +08:00
parent 79fd133821
commit 302617cd81
12 changed files with 197 additions and 46 deletions

View File

@@ -308,7 +308,7 @@ class StatsController extends Controller
->field("FROM_UNIXTIME(addTime, '%m-%d') AS d, COUNT(*) AS c")
->where(['task_id' => $taskId])
->where('addTime', 'between', [$startTimestamp, $endTimestamp])
->whereIn('status', [1, 2, 4])
->whereIn('status', [1, 2, 4, 5])
->group('d')
->select();

View File

@@ -84,7 +84,7 @@ class StoreAccountController extends BaseController
'phone' => $phone,
'passwordMd5' => md5($password),
'passwordLocal' => localEncrypt($password),
'avatar' => 'https://img.icons8.com/color/512/circled-user-male-skin-type-7.png',
'avatar' => '',
'isAdmin' => 0,
'companyId' => $companyId,
'typeId' => 2, // 门店端固定为2

View File

@@ -405,8 +405,8 @@ class PlanSceneV1Controller extends BaseController
->field([
'task_id as taskId',
'COUNT(1) as acquiredCount',
"SUM(CASE WHEN status IN (1,2,3,4) THEN 1 ELSE 0 END) as addedCount",
"SUM(CASE WHEN status = 4 THEN 1 ELSE 0 END) as passCount",
"SUM(CASE WHEN status IN (1,2,3,4,5) THEN 1 ELSE 0 END) as addedCount",
"SUM(CASE WHEN status IN (4,5) THEN 1 ELSE 0 END) as passCount",
'MAX(updateTime) as lastUpdated'
])
->group('task_id')
@@ -511,7 +511,7 @@ class PlanSceneV1Controller extends BaseController
$query = Db::name('task_customer')->where(['task_id' => $task['id']]);
if ($type == 2){
$query = $query->where('status',4);
$query = $query->whereIn('status',[4,5]);
}
if (!empty($keyword)) {

View File

@@ -179,7 +179,7 @@ class GetWechatController extends BaseController
'activityLevel' => $this->getActivityLevel($wechatId),
'accountWeight' => $this->getAccountWeight($wechatId),
'statistics' => $this->getStatistics($wechatId),
'restrictions' => $this->getRestrict($wechatId),
// 'restrictions' => $this->getRestrict($wechatId),
];

View File

@@ -216,7 +216,7 @@ class Adapter implements WeChatServiceInterface
// 根据健康分判断24h内加的好友数量限制
$healthScoreService = new WechatAccountHealthScoreService();
$healthScoreInfo = $healthScoreService->getHealthScore($accountId);
// 如果健康分记录不存在,先计算一次
if (empty($healthScoreInfo)) {
try {
@@ -228,10 +228,10 @@ class Adapter implements WeChatServiceInterface
$maxAddFriendPerDay = 5;
}
}
// 获取每日最大加人次数(基于健康分)
$maxAddFriendPerDay = $healthScoreInfo['maxAddFriendPerDay'] ?? 5;
// 如果健康分为0或很低不允许添加好友
if ($maxAddFriendPerDay <= 0) {
Log::info("账号健康分过低,不允许添加好友 (accountId: {$accountId}, wechatId: {$wechatId}, healthScore: " . ($healthScoreInfo['healthScore'] ?? 0) . ")");
@@ -367,6 +367,10 @@ class Adapter implements WeChatServiceInterface
if (!empty($wechatId)) {
$isFriend = $this->checkIfIsWeChatFriendByPhone($wechatId, $task['phone']);
if ($isFriend) {
// 更新状态为5已通过未发消息
Db::name('task_customer')
->where('id', $task['id'])
->update(['status' => 5,'passTime' => time(), 'updateTime' => time()]);
$passedWeChatId = $wechatId;
break;
}