客服端 内容管理功能

This commit is contained in:
wong
2025-10-13 16:14:33 +08:00
parent 381eb37f1a
commit 6e2fc369e2
11 changed files with 963 additions and 26 deletions

View File

@@ -17,6 +17,7 @@ Route::group('v1/', function () {
// 设备管理相关
Route::group('devices', function () {
Route::get('isUpdataWechat', 'app\cunkebao\controller\device\GetDeviceDetailV1Controller@isUpdataWechat');
Route::put('refresh', 'app\cunkebao\controller\device\RefreshDeviceDetailV1Controller@index');
Route::get('add-results', 'app\cunkebao\controller\device\GetAddResultedV1Controller@index');
Route::post('task-config', 'app\cunkebao\controller\device\UpdateDeviceTaskConfigV1Controller@index');
@@ -38,8 +39,6 @@ Route::group('v1/', function () {
Route::get(':wechatId', 'app\cunkebao\controller\wechat\GetWechatProfileV1Controller@index');
Route::post('transfer-friends', 'app\cunkebao\controller\wechat\PostTransferFriends@index'); // 微信好友转移
Route::get('count', 'app\cunkebao\controller\DeviceWechat@count');
Route::get('device-count', 'app\cunkebao\controller\DeviceWechat@deviceCount'); // 获取有登录微信的设备数量
Route::put('refresh', 'app\cunkebao\controller\DeviceWechat@refresh'); // 刷新设备微信状态
@@ -71,8 +70,6 @@ Route::group('v1/', function () {
Route::post('addPackage', 'app\cunkebao\controller\traffic\GetPotentialListWithInCompanyV1Controller@addPackage');
Route::get('converted', 'app\cunkebao\controller\traffic\GetConvertedListWithInCompanyV1Controller@index');
Route::get('types', 'app\cunkebao\controller\traffic\GetPotentialTypeSectionV1Controller@index');
Route::get('sources', 'app\cunkebao\controller\traffic\GetTrafficSourceSectionV1Controller@index');

View File

@@ -155,4 +155,34 @@ class GetDeviceDetailV1Controller extends BaseController
return ResponseHelper::error($e->getMessage(), $e->getCode());
}
}
public function isUpdataWechat()
{
$id = $this->request->param('id/d');
$companyId = $this->getUserInfo('companyId');
$newWechat = DeviceWechatLoginModel::alias('a')
->field('b.*')
->join('wechat_account b', 'a.wechatId = b.wechatId')
->where(['a.deviceId' => $id,'a.isTips' => 0,'a.companyId' => $companyId])
->order('a.id', 'desc')
->find();
if (empty($newWechat)){
return ResponseHelper::success('','该设备绑定的微信无需迁移',201);
}
$oldWechat = DeviceWechatLoginModel::alias('a')
->field('b.*')
->join('wechat_account b', 'a.wechatId = b.wechatId')
->where(['a.companyId' => $companyId])
->where('a.deviceId' ,'<>', $id)
->order('a.id', 'desc')
->find();
if (empty($oldWechat)){
return ResponseHelper::success('','该设备绑定的微信无需迁移',201);
}else{
DeviceWechatLoginModel::where(['deviceId' => $id,'isTips' => 0,'companyId' => $companyId])->update(['isTips' => 1]);;
return ResponseHelper::success(['newWechat' => $newWechat,'oldWechat' => $oldWechat]);
}
}
}