| xqd
@@ -7,6 +7,7 @@ namespace App\Services;
|
|
|
use App\Models\DynamicZanModel;
|
|
|
use App\Models\UserLikeModel;
|
|
|
use App\Models\UserSystemMessageModel;
|
|
|
+use PHPUnit\Util\Exception;
|
|
|
use function Symfony\Component\Translation\t;
|
|
|
|
|
|
class NoticeService
|
| xqd
@@ -90,5 +91,20 @@ class NoticeService
|
|
|
return $query;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除消息
|
|
|
+ */
|
|
|
+ public function del_message($id){
|
|
|
+ if(empty($id)){
|
|
|
+ throw new Exception("参数错误");
|
|
|
+ }
|
|
|
+ if(!$message = UserSystemMessageModel::query()->find($id)){
|
|
|
+ throw new Exception("消息不存在");
|
|
|
+ }
|
|
|
+ $message->is_delete = 1;
|
|
|
+ $message->save();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|