You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
68
hyhproject/admin/controller/Adgoods.php
Executable file
68
hyhproject/admin/controller/Adgoods.php
Executable file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace wstmart\admin\controller;
|
||||
use wstmart\admin\model\Adgoods as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告控制器
|
||||
*/
|
||||
class Adgoods extends Base{
|
||||
|
||||
public function index(){
|
||||
$result=db('ads')->field('adName,adId')->order('adId desc')->select();
|
||||
return $this->fetch("list",['result'=>$result]);
|
||||
}
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
return WSTGrid($m->pageQuery());
|
||||
}
|
||||
/**
|
||||
* 跳去编辑页面
|
||||
*/
|
||||
public function toEdit(){
|
||||
$m = new M();
|
||||
$data = $m->getById(Input("id/d",0));
|
||||
if($data) $data['adName']=db('ads')->where('adId',$data['adId'])->value('adName');
|
||||
$result=db('ads')->field('adName,adId')->order('adId desc')->select();
|
||||
return $this->fetch("edit",['data'=>$data,'result'=>$result]);
|
||||
}
|
||||
/*
|
||||
* 获取数据
|
||||
*/
|
||||
public function get(){
|
||||
$m = new M();
|
||||
return $m->getById(Input("id/d",0));
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
return $m->add();
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
public function edit(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$m = new M();
|
||||
return $m->del();
|
||||
}
|
||||
/**
|
||||
* 修改广告排序
|
||||
*/
|
||||
public function changeSort(){
|
||||
$m = new M();
|
||||
return $m->changeSort();
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user