41 lines
954 B
PHP
41 lines
954 B
PHP
<?php
|
|
namespace app\admin\controller;
|
|
use app\common\controller\Admin;
|
|
use think\Request;
|
|
use think\Loader;
|
|
|
|
/**
|
|
* 巨量域名管理
|
|
*/
|
|
class Promotedomain extends Admin{
|
|
|
|
public function index(){
|
|
$res=db('promote_domain')->order('id desc')->select();
|
|
$this->assign('res', $res);
|
|
$this->setMeta('巨量域名管理');
|
|
return $this->fetch();
|
|
}
|
|
|
|
public function add(){
|
|
$data = input('');
|
|
if($data){
|
|
$res = db('promote_domain')->insert($data);
|
|
if($res){
|
|
exit(json_encode(array('status'=>1,'reg'=>'添加成功')));
|
|
}else{
|
|
exit(json_encode(array('status'=>2,'reg'=>'失败')));
|
|
}
|
|
}
|
|
}
|
|
|
|
public function del($id){
|
|
if($id){
|
|
$res = db('promote_domain')->delete($id);
|
|
if($res){
|
|
return 1;
|
|
}else{
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
} |