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.
52 lines
1.7 KiB
52 lines
1.7 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2016~2020 https://www.tczxkj.com All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权
|
|
// +----------------------------------------------------------------------
|
|
// | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\admin\controller\article;
|
|
|
|
use app\admin\controller\AuthController;
|
|
use service\JsonService as Json;
|
|
use service\UploadService as Upload;
|
|
use think\Request;
|
|
use think\Url;
|
|
use service\FormBuilder as Form;
|
|
use app\admin\model\article\Search as SearchModel;
|
|
|
|
/**
|
|
* 搜索
|
|
* Class Search
|
|
* @package app\admin\controller\article
|
|
*/
|
|
class Search extends AuthController
|
|
{
|
|
public function index()
|
|
{
|
|
$this->assign('list', SearchModel::getAll());
|
|
return $this->fetch();
|
|
}
|
|
|
|
public function save($name = '')
|
|
{
|
|
if (!$name) return Json::fail('请输入热词名称');
|
|
if ($res = SearchModel::saveSearch($name))
|
|
return Json::successful('添加成功', $res);
|
|
else
|
|
return Json::fail(SearchModel::getErrorInfo('添加失败'));
|
|
}
|
|
|
|
public function del_search($id = 0)
|
|
{
|
|
if (!$id) return Json::fail('缺少参数');
|
|
if (SearchModel::del($id))
|
|
return Json::successful('删除成功');
|
|
else
|
|
return Json::fail('删除失败');
|
|
}
|
|
}
|
|
|