私域抄盘手 - 修改微信号相关路由规则 及 统一微信号信息查询规则
This commit is contained in:
@@ -41,8 +41,8 @@ class GetWechatOnDeviceFriendsV1Controller extends BaseController
|
||||
$query = WechatFriendShipModel::alias('f')
|
||||
->field(
|
||||
[
|
||||
'w.id', 'w.nickname', 'w.avatar',
|
||||
'CASE WHEN w.alias IS NULL OR w.alias = "" THEN w.wechatId ELSE w.alias END AS wechatId',
|
||||
'w.id', 'w.nickname', 'w.avatar', 'w.wechatId',
|
||||
'CASE WHEN w.alias IS NULL OR w.alias = "" THEN w.wechatId ELSE w.alias END AS wechatAccount',
|
||||
'f.memo', 'f.tags'
|
||||
]
|
||||
)
|
||||
@@ -60,25 +60,6 @@ class GetWechatOnDeviceFriendsV1Controller extends BaseController
|
||||
return $query->paginate($this->request->param('limit/d', 10), false, ['page' => $this->request->param('page/d', 1)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原始的64位的微信id
|
||||
*
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getStringWechatIdByNumberId(): string
|
||||
{
|
||||
$account = WechatAccountModel::find(
|
||||
$this->request->param('id/d')
|
||||
);
|
||||
|
||||
if (is_null($account)) {
|
||||
throw new \Exception('微信账号不存在', 404);
|
||||
}
|
||||
|
||||
return $account->wechatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
*
|
||||
@@ -92,7 +73,7 @@ class GetWechatOnDeviceFriendsV1Controller extends BaseController
|
||||
$where[] = ['exp', "f.memo LIKE '%{$keyword}%' OR f.tags LIKE '%{$keyword}%'"];
|
||||
}
|
||||
|
||||
$where['f.ownerWechatId'] = $this->getStringWechatIdByNumberId();
|
||||
$where['f.ownerWechatId'] = $this->request->param('id/s') ?: 'x_x';
|
||||
|
||||
return array_merge($where, $params);
|
||||
}
|
||||
|
||||
@@ -233,25 +233,6 @@ class GetWechatOnDeviceSummarizeV1Controller extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原始的64位的微信id
|
||||
*
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getStringWechatIdByNumberId(): string
|
||||
{
|
||||
$account = WechatAccountModel::find(
|
||||
$this->request->param('id/d')
|
||||
);
|
||||
|
||||
if (is_null($account)) {
|
||||
throw new \Exception('微信账号不存在', 404);
|
||||
}
|
||||
|
||||
return $account->wechatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信号详情
|
||||
*
|
||||
@@ -260,7 +241,7 @@ class GetWechatOnDeviceSummarizeV1Controller extends BaseController
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
$wechatId = $this->getStringWechatIdByNumberId();
|
||||
$wechatId = $this->request->param('id/s');
|
||||
|
||||
// 以下内容依次加工数据
|
||||
$accountAge = $this->getRegisterDate($wechatId);
|
||||
|
||||
@@ -10,7 +10,7 @@ use library\ResponseHelper;
|
||||
/**
|
||||
* 设备微信控制器
|
||||
*/
|
||||
class GetWechatOnDeviceFriendProfileV1Controller extends BaseController
|
||||
class GetWechatProfileV1Controller extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取最近互动时间
|
||||
@@ -63,11 +63,11 @@ class GetWechatOnDeviceFriendProfileV1Controller extends BaseController
|
||||
/**
|
||||
* 获取微信账号
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $wechatId
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getWechatAccountProfileById(int $id): array
|
||||
protected function getWechatAccountProfileByWechatId(string $wechatId): array
|
||||
{
|
||||
$account = WechatAccountModel::alias('w')
|
||||
->field(
|
||||
@@ -78,7 +78,8 @@ class GetWechatOnDeviceFriendProfileV1Controller extends BaseController
|
||||
]
|
||||
)
|
||||
->join('wechat_friendship f', 'w.wechatId=f.wechatId')
|
||||
->find($id);
|
||||
->where('w.wechatId', $wechatId)
|
||||
->find();
|
||||
|
||||
if (is_null($account)) {
|
||||
throw new \Exception('未获取到微信账号数据', 404);
|
||||
@@ -95,8 +96,8 @@ class GetWechatOnDeviceFriendProfileV1Controller extends BaseController
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
$results = $this->getWechatAccountProfileById(
|
||||
$this->request->param('aId/d')
|
||||
$results = $this->getWechatAccountProfileByWechatId(
|
||||
$this->request->param('wechatId/s')
|
||||
);
|
||||
|
||||
return ResponseHelper::success(
|
||||
@@ -198,8 +198,8 @@ class GetWechatsOnDevicesV1Controller extends BaseController
|
||||
$query = WechatAccountModel::alias('w')
|
||||
->field(
|
||||
[
|
||||
'w.id', 'w.nickname', 'w.avatar',
|
||||
'CASE WHEN w.alias IS NULL OR w.alias = "" THEN w.wechatId ELSE w.alias END AS wechatId',
|
||||
'w.id', 'w.nickname', 'w.avatar', 'w.wechatId',
|
||||
'CASE WHEN w.alias IS NULL OR w.alias = "" THEN w.wechatId ELSE w.alias END AS wechatAccount',
|
||||
'l.deviceId'
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user