欢迎使用CSDN-markdown编辑器

来源:互联网 发布:js replace all 编辑:程序博客网 时间:2024/06/06 01:10
<?php/** * Date:        2015/4/24 * @author:     tianwen.Sun * @copyright   2015 daxidi All rights reserved. * @description:BlogsController.class.php */namespace Home\Logic;use Think\Model;class BlogLogic{    public function getBlog($blogid){        $blogModel=new \Home\Model\BlogModel();        $res=$blogModel->getBlog($blogid);        if(!$res){            return false;        }        return $res;    }    public function getBlogs($uid){        $blogModel=new \Home\Model\BlogModel();        $res=$blogModel->getBlogList($uid);        if(!$res){            return false;        }        return $res;    }    public function getDefaultBlogList(){        $blogModel=new \Home\Model\BlogModel();        $res=$blogModel->getDefaultBlogList();        if(!$res){            return false;        }        return $res;    }    public function saveBlog($uid,$title,$content,$canreview=1,$status=1){        $time=timenow();        $data = array(            "userid"        =>      $uid,            "title"         =>      $title,            "sort"          =>      "",            "tags"          =>      "",            "content"       =>      $content,            "createon"      =>      $time,            "canreview"     =>      $canreview,            "status"        =>      $status,            "lastedittime"  =>      $time,        );        $blogModel=new \Home\Model\BlogModel();        return $blogModel->addBlog($data);    }}
0 0
原创粉丝点击