You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB
PHTML

2 years ago
<?php
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class CertController extends ThinkController {
const model_name = 'Applecert';
public function lists(){
$extend = array('key'=>'gift_name');
parent::lists(self::model_name,$_GET["p"],$extend);
}
public function record(){
parent::lists('GiftRecord',$_GET["p"],$extend);
}
public function add(){
if(IS_POST){
if($_REQUEST['name']==''){
$this->error('证书名称不能为空');
}
if(IS_POST){
$data['name']=$_REQUEST['name'];
$data['updatetime'] = time();
M('Applecert')->add($data);
$this->success('添加'.$model['title'].'成功!', U('lists?model='.$model['name']));
} else {
$this->error($Model->getError());
}
} else {
$this->meta_title = '新增ios证书';
$this->display('add');
}
}
public function del($model = null, $ids=null){
$model = M('Model')->getByName(self::model_name); /*通过Model名称获取Model完整信息*/
parent::del($model["id"],$ids);
}
}