You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
582 B
30 lines
582 B
<?php
|
|
|
|
namespace addons\qingdong\controller;
|
|
|
|
use addons\qingdong\model\File as FileModel;
|
|
|
|
/**
|
|
* 附件接口
|
|
*/
|
|
class File extends StaffApi {
|
|
protected $noNeedLogin = [];
|
|
protected $noNeedRight = [];
|
|
|
|
|
|
//修改附件名称
|
|
public function editName() {
|
|
$id = input("id", 0);
|
|
$name = input('name', '');
|
|
$filemodel = new FileModel();
|
|
$row = $filemodel->get($id);
|
|
if (empty($row)) {
|
|
$this->error('附件不存在');
|
|
}
|
|
if ($row->save(['name' => $name])) {
|
|
$this->success('修改成功');
|
|
} else {
|
|
$this->error('修改失败');
|
|
}
|
|
}
|
|
}
|
|
|