|
@@ -326,6 +326,20 @@ class Api extends BaseController {
|
|
|
return json(["msg" => "不能删除"]);
|
|
|
}
|
|
|
|
|
|
+ public function deleteTalentCommonFile() {
|
|
|
+ $param = $this->request->param();
|
|
|
+ $where = [["id", "=", $param["id"]]];
|
|
|
+ $file = Db::table("new_talent_common_file")->where($where)->findOrEmpty();
|
|
|
+ $filepath = "storage/" . $file["url"];
|
|
|
+ if (file_exists($filepath)) {
|
|
|
+ unlink($filepath);
|
|
|
+ }
|
|
|
+ Db::table("new_talent_common_file")->delete($file["id"]);
|
|
|
+ //TalentLogApi::write($file["type"], $file["mainId"], 0, sprintf("删除附件,附件名为:%s", $file["orignName"]), 1, $file["typeId"], $param["id"]);
|
|
|
+ return json(["code" => 200, "msg" => "删除成功"]);
|
|
|
+ return json(["msg" => "不能删除"]);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 下载文件
|
|
|
*/
|