2025-08-07 20:21:47 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
|
|
|
|
use app\common\controller\BaseCom;
|
|
|
|
|
|
use think\Db;
|
|
|
|
|
|
|
|
|
|
|
|
class Report extends BaseCom
|
|
|
|
|
|
{
|
|
|
|
|
|
//举报类型列表
|
|
|
|
|
|
public function report_type_list(){
|
|
|
|
|
|
$list = db::name('vs_user_inform_type')->where(['delete_time' => ['<',1]])->select();
|
|
|
|
|
|
foreach ($list as &$item) {
|
|
|
|
|
|
$item['createtime'] = date('Y-m-d H:i:s', $item['createtime']);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return V(1,"成功", $list);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//举报
|
|
|
|
|
|
public function report(){
|
|
|
|
|
|
// $user_id = input('user_id', '');//举报者
|
|
|
|
|
|
$type_id = input('type_id', '');//举报类型
|
|
|
|
|
|
$report_type = input('report_type', '');//1-用户,2房间,3动态
|
|
|
|
|
|
$content = input('content', '');//举报内容
|
|
|
|
|
|
$image = input('image', '');//举报图片,多个用英文逗号隔开
|
|
|
|
|
|
$from_id = input('from_id', '');//举报来源id
|
|
|
|
|
|
if($type_id == '' || $report_type == '' || $from_id == ''){
|
|
|
|
|
|
return V(0,"参数错误",null);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
|
|
'user_id' => $this->uid,
|
|
|
|
|
|
'type_id' => $type_id,
|
|
|
|
|
|
'report_type' => $report_type,
|
|
|
|
|
|
'content' => $content,
|
|
|
|
|
|
'image' => $image,
|
|
|
|
|
|
'from_id' => $from_id,
|
|
|
|
|
|
'createtime' => time(),
|
|
|
|
|
|
];
|
|
|
|
|
|
$res = db::name('vs_user_inform')->insert($data);
|
|
|
|
|
|
return V($res ? 1 : 0, $res ? "成功" : "失败", null);
|
|
|
|
|
|
}
|
2025-11-13 10:59:56 +08:00
|
|
|
|
//安卓日志提交
|
|
|
|
|
|
public function android_log_report(){
|
|
|
|
|
|
$log_name = input('log_name', '');
|
|
|
|
|
|
$log_url = input('log_url', '');
|
|
|
|
|
|
$user_id = $this->uid;
|
|
|
|
|
|
$data = [
|
|
|
|
|
|
'log_name' => $log_name,
|
|
|
|
|
|
'log_url' => $log_url,
|
|
|
|
|
|
'user_id' => $user_id,
|
|
|
|
|
|
'createtime' => time(),
|
|
|
|
|
|
];
|
|
|
|
|
|
$res = db::name('vs_android_log')->insert($data);
|
|
|
|
|
|
return V($res ? 1 : 0, $res ? "成功" : "失败", null);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-08-07 20:21:47 +08:00
|
|
|
|
|
|
|
|
|
|
}
|