删除消息

This commit is contained in:
yaooo 2023-11-01 15:38:15 +08:00
parent c1598d9c6e
commit 7e3851f7cb
2 changed files with 26 additions and 1 deletions

View File

@ -111,4 +111,29 @@ class MessageIndex extends ApiController
$this->apiSuccess('查看成功', $detail);
}
//消息删除
public function delete()
{
$param = get_params();
$this->uid = JWT_UID;
$param = get_params();
$type = 4;
$ids = empty($param['ids']) ? 0 : $param['ids'];
$idArray = explode(',', $ids);
$list = [];
foreach ($idArray as $key => $val) {
$list[] = [
'status' => -1,
'id' => $val,
'update_time' => time(),
];
}
foreach ($list as $key => $v) {
if (MessageList::update($v) !== false) {
add_log('delete', $v['id'],[],'消息');
}
}
$this->apiSuccess('操作成功');
}
}

View File

@ -693,7 +693,7 @@ function add_log($type, $param_id = '', $param = [] ,$subject='')
$uid = JWT_UID;
}
$type_action = get_config('log.type_action');
if($type_action[$type]){
if(!empty($type_action[$type])){
$title = $type_action[$type];
}
$data = [