群信息
This commit is contained in:
@@ -17,6 +17,26 @@ class GroupController extends ApiController
|
||||
{
|
||||
|
||||
|
||||
public function shopInfo(Request $request): Response
|
||||
{
|
||||
$group_id = $request->post('shop_id');
|
||||
if (empty($group_id)) {
|
||||
return $this->error('参数不存在');
|
||||
}
|
||||
$group_arr = Db::name('chat_group')->where(['shop_id' => $group_id])->select()->toArray();
|
||||
if($group_arr) {
|
||||
foreach ($group_arr as $k => $v) {
|
||||
// 先判断在没在群里
|
||||
$group_arr[$k]['is_th'] = 1;
|
||||
$mute = Db::name('chat_group_mute')->where(['group_id' => $v['id'], 'user_id' => 0])->find();
|
||||
$group_arr[$k]['is_mute'] = $mute?1:0;
|
||||
}
|
||||
}
|
||||
return $this->success($group_arr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function info(Request $request): Response
|
||||
{
|
||||
$group_id = $request->post('group_id');
|
||||
|
||||
@@ -26,6 +26,7 @@ Route::group('/api/chat', function () {
|
||||
|
||||
// 群聊管理
|
||||
Route::group('/group', function () {
|
||||
Route::post('/shopinfo', app\chat\controller\GroupController::class . '@shopInfo'); // 店铺群信息
|
||||
Route::post('/info', app\chat\controller\GroupController::class . '@info'); // 群信息
|
||||
Route::post('/create', app\chat\controller\GroupController::class . '@create'); // 创建群(商家)
|
||||
Route::post('/join', app\chat\controller\GroupController::class . '@join'); // 加群
|
||||
|
||||
Reference in New Issue
Block a user