no message
This commit is contained in:
parent
2507bea1f8
commit
b233037210
@ -166,6 +166,39 @@ class Arma extends Base {
|
|||||||
return $sMsg;
|
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)
|
private function imgPathByUrl($sImgUrl)
|
||||||
{
|
{
|
||||||
list(, $sImgPath) = explode("upload", $sImgUrl, 2);
|
list(, $sImgPath) = explode("upload", $sImgUrl, 2);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user