Application/Admin/Controller/NewsController.class.php
(完整代码) 759B<?php
namespace Admin\Controller;
use Think\Controller;
class NewsController extends CommonController {
public function newsedit(){
$ntype = I('ntype',0,'intval');
$news = M('news')->where("ntype=%d",$ntype)->find();
$this->news = $news;
$this->ntype = $ntype;
$this->display();
}
public function newssave(){
$ntype = I('get.ntype',0,'intval');
$data['ncontent'] = replace_conent_img(I('ncontent','',''));
$news = M('news')->where("ntype=%d",$ntype)->find();
if(!$news){
$data['ntype'] = $ntype;
$data['ntime'] = time();
M('news')->add($data);
} else {
$data['id'] = $news['id'];
M('news')->save($data);
}
$this->success('操作成功',U('newsedit?ntype='.$ntype),1);
}
}
?>
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。