feat: 完善分销中心与团队明细接口,增强商户与帖子交互细节
这个提交包含在:
@@ -62,6 +62,35 @@ class Merchant extends V1
|
||||
// 首屏拉取前 6 条该商家的有效发帖
|
||||
$posts = $this->fetchMerchantPosts($m['user_id'], 1, 6);
|
||||
|
||||
// 严格保护商家联系电话:未付费解锁或非会员状态下脱敏,杜绝从信息详情页跳转商家主页白嫖绕过
|
||||
$rawContact = (string)(isset($m['contact']) ? $m['contact'] : '');
|
||||
$unlocked = false;
|
||||
$me = $this->user();
|
||||
if ($me) {
|
||||
$now = time();
|
||||
$ext = $this->ext($me['id']);
|
||||
$isMember = (int)$ext['is_member'] === 1
|
||||
&& !empty($ext['member_expiretime']) && (int)$ext['member_expiretime'] > $now;
|
||||
$isOwner = (int)$m['user_id'] === (int)$me['id'];
|
||||
if ($isOwner || $isMember) {
|
||||
$unlocked = true;
|
||||
} else {
|
||||
// 检查是否从已解锁的关联信息跳转而来
|
||||
$postId = (int)$this->input('postId', 0);
|
||||
if ($postId > 0) {
|
||||
$paidView = Db::name('fc_pay_view')
|
||||
->where('user_id', $me['id'])
|
||||
->where('post_id', $postId)
|
||||
->find();
|
||||
if ($paidView) {
|
||||
$unlocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$displayContact = $unlocked ? $rawContact : $this->maskPhone($rawContact);
|
||||
|
||||
$data = [
|
||||
'id' => (int)$m['id'],
|
||||
'userId' => (int)$m['user_id'],
|
||||
@@ -71,7 +100,8 @@ class Merchant extends V1
|
||||
'address' => (string)(isset($m['address']) ? $m['address'] : ''),
|
||||
'lat' => (isset($m['lat']) && $m['lat'] !== null && $m['lat'] !== '') ? (float)$m['lat'] : null,
|
||||
'lng' => (isset($m['lng']) && $m['lng'] !== null && $m['lng'] !== '') ? (float)$m['lng'] : null,
|
||||
'contact' => (string)(isset($m['contact']) ? $m['contact'] : ''),
|
||||
'contact' => $displayContact,
|
||||
'unlocked' => $unlocked,
|
||||
'category' => (string)(isset($m['category']) ? $m['category'] : ''),
|
||||
'notice' => (string)(isset($m['notice']) ? $m['notice'] : ''),
|
||||
'auditStatus' => (int)$m['audit_status'],
|
||||
|
||||
在新工单中引用
屏蔽一个用户