no message

This commit is contained in:
hellcat 2026-03-11 16:45:42 +08:00
parent 2507bea1f8
commit b233037210

View File

@ -166,6 +166,39 @@ class Arma extends Base {
return $sMsg;
}
public function del_self_xiuren($aParam)
{
$iId = $aParam["aArg"][1] ?? false;
if (!$iId) {
return "没有id";
}
if ($iId == "?") {
return "#del [id]";
}
$oArticleSchema = ModelArticleSchema::where("id", $iId)->first();
$aSchema = json_decode($oArticleSchema->schema, true);
$i = 0;
foreach ($aSchema["data"] as $aSchemaDataRow) {
if ($aSchemaDataRow["type"] == "photo") {
foreach ($aSchemaDataRow["photo"] as $aSchemaDataRowPhoto) {
$sImgA = $this->imgPathByUrl($aSchemaDataRowPhoto["file_path"]);
$i += $this->imgDelByPath($sImgA);
}
}
}
$oArticleSchema->delete();
$sMsg = "ok同时删除了{$i}张图片。";
return $sMsg;
}
private function imgPathByUrl($sImgUrl)
{
list(, $sImgPath) = explode("upload", $sImgUrl, 2);