- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\controller\api\v1\work;
|
|
|
|
|
|
use app\services\work\WorkGroupChatMemberServices;
|
|
use app\services\work\WorkGroupChatServices;
|
|
use crmeb\services\wechat\config\WorkConfig;
|
|
use think\annotation\Inject;
|
|
use think\db\exception\DataNotFoundException;
|
|
use think\db\exception\DbException;
|
|
use think\db\exception\ModelNotFoundException;
|
|
|
|
/**
|
|
* 客户群
|
|
* Class GroupChatController
|
|
* @package app\controller\api\v1\work
|
|
*/
|
|
class GroupChat extends BaseWork
|
|
{
|
|
|
|
/**
|
|
* @var WorkGroupChatServices
|
|
*/
|
|
#[Inject]
|
|
protected WorkGroupChatServices $service;
|
|
|
|
/**
|
|
* @param WorkConfig $config
|
|
* @return mixed
|
|
* @throws DataNotFoundException
|
|
* @throws DbException
|
|
* @throws ModelNotFoundException
|
|
*/
|
|
public function getGroupInfo(WorkConfig $config)
|
|
{
|
|
$chatId = $this->request->param('chat_id');
|
|
if (!$chatId) {
|
|
return $this->fail('缺少参数');
|
|
}
|
|
$corpId = $config->corpId;
|
|
return $this->success($this->service->getGroupInfo($chatId, $corpId));
|
|
}
|
|
|
|
/**
|
|
* 获取群成员列表
|
|
* @param WorkGroupChatMemberServices $services
|
|
* @param $id
|
|
* @return mixed
|
|
*/
|
|
public function getChatMemberList(WorkGroupChatMemberServices $services, $id)
|
|
{
|
|
if (!$id) {
|
|
return $this->fail('缺少参数');
|
|
}
|
|
$name = $this->request->get('name', '');
|
|
return $this->success($services->getChatMemberList((int)$id, $name));
|
|
}
|
|
}
|