| 12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\user\model;
- use think\Model;
- class UserComment extends Model{
- protected $createTime = "inputtime";
- protected $updateTime = '';
- protected $autoWriteTimestamp = 'datetime'; // 开启自动写入时间戳字段
-
- public function initialize(){
- parent::initialize();
- }
-
- public function getInfo($user, $type, $page = 0){
- return $this->db()
- ->field("comment_id s, inputtime t, content c")
- ->where(['user_id'=>$user, "type"=>$type])
- ->page($page, config('paginate.list_rows'))
- ->order("inputtime DESC")
- ->select();
- }
-
- public function add($data){
- return $this->save($data);
- }
-
- }
|