| xqd
@@ -1,6 +1,7 @@
|
|
|
<?php
|
|
|
namespace App\Admin\Actions\Chat;
|
|
|
use App\Models\ChatList;
|
|
|
+use App\Models\User;
|
|
|
use App\Repositories\ImMessage;
|
|
|
use App\Services\TencentImMessage;
|
|
|
use Dcat\Admin\Grid;
|
| xqd
@@ -14,8 +15,24 @@ class ChatLog extends LazyRenderable
|
|
|
|
|
|
return Grid::make(new ImMessage($chat_data->user_id,$chat_data->to_user_id), function (Grid $grid) {
|
|
|
$grid->column('user_id', 'ID')->sortable();
|
|
|
- $grid->column('From_Account');
|
|
|
- $grid->column('To_Account');
|
|
|
+ $grid->column('From_Account')->display(function ($res){
|
|
|
+ $user = User::query()->where('tencent_im_user_id',$res)->with("user_info")->first();
|
|
|
+ $str = "";
|
|
|
+ $str.="<div style='margin-right:10px;text-align: center'>";
|
|
|
+ $str.='<img data-action="preview-img" src="'.$user->user_info->avatar.'" style="max-width:50px;max-height:50px;cursor:pointer" class="img img-thumbnail">';
|
|
|
+ $str.='<p style="margin-top: 5px">'.$user->user_info->nickname.'</p>';
|
|
|
+ $str.="</div>";
|
|
|
+ return $str;
|
|
|
+ });
|
|
|
+ $grid->column('To_Account')->display(function ($res){
|
|
|
+ $user = User::query()->where('tencent_im_user_id',$res)->with("user_info")->first();
|
|
|
+ $str = "";
|
|
|
+ $str.="<div style='margin-right:10px;text-align: center'>";
|
|
|
+ $str.='<img data-action="preview-img" src="'.$user->user_info->avatar.'" style="max-width:50px;max-height:50px;cursor:pointer" class="img img-thumbnail">';
|
|
|
+ $str.='<p style="margin-top: 5px">'.$user->user_info->nickname.'</p>';
|
|
|
+ $str.="</div>";
|
|
|
+ return $str;
|
|
|
+ });
|
|
|
$grid->column('MsgTimeStamp');
|
|
|
$grid->column('MsgBody')->display(function ($res){
|
|
|
//dd($res);
|