mirror of https://github.com/1099438829/apeblog
修复修改轮播广告的bug
This commit is contained in:
parent
1d35393458
commit
1ba8bfcc4f
|
|
@ -4,6 +4,7 @@ namespace app\admin\controller;
|
|||
|
||||
use app\admin\extend\Util as Util;
|
||||
use app\admin\model\AdminLog as lModel;
|
||||
use app\common\model\AdvertInfo;
|
||||
use app\Request;
|
||||
use Exception;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
|
|
|
|||
|
|
@ -254,6 +254,9 @@ class Advert extends AuthController
|
|||
* 保存修改
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function saveAdvert($id = "")
|
||||
{
|
||||
|
|
@ -283,4 +286,18 @@ class Advert extends AuthController
|
|||
cache(Data::DATA_ADVERT . '_' . $info['alias'], null);//清除缓存
|
||||
return $res ? app("json")->success("操作成功", 'code') : app("json")->fail("操作失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function delAdvert(Request $request)
|
||||
{
|
||||
$where = Util::postMore([
|
||||
['id', ''],
|
||||
],$request);
|
||||
if (empty($where['id'])) return app("json")->fail("参数错误,请刷新后重试");
|
||||
return (new \app\common\model\AdvertInfo)->where('id',$where['id'])->delete() ? app("json")->success("删除成功") : app("json")->fail("删除失败");
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ class Image extends AuthController
|
|||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function category(): array
|
||||
public function category()
|
||||
{
|
||||
return app("json")->success(AttachmentCategory::buildNodes($this->type, 0, $this->request->param("title", "")));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue