自动完成失效

浏览:954 发布日期:2015/09/29 分类:求助交流 关键字: 自动完成 失效
NewsModel.class.php<?php
namespace Home\Model;
use Think\Model;
class NewsModel extends Model{
    // 定义自动验证
    protected $_validate = array(
        array(),
        );
    // 定义自动完成
    protected $_auto = array(
        array('post_time','time',3,'function'),
        );
}
IndexController.class.php    public function insert()
    {
        // echo "save_member";
        // dump(I("post."));
        $News = D('News');
        if ($News->create()) {
            // $News->post_time = NOW_TIME;
            $result = $News->add();
            if ($result) {
                $this->success('数据添加成功!');
                // echo $News->getLastSql();
            } else {
                $this->error('数据添加错误!');
            }
            
        } else {
            $this->error($News->getError());
        }
    }
数据库的post_time 没有数据
最佳答案
评论( 相关
后面还有条评论,点击查看>>