<?php

namespace app\common\model;

use think\Model;

class Jobcv extends Model
{
    public $page_info;

    /**
     * 历史记录
     * @param unknown $condition
     * @return boolean
     */
    public function addJobcv($data)
    {
        return db('jobcv')->insert($data);
    }
  
    public function editJobcv($condition, $update)
    {
        return db('jobcv')->where($condition)->update($update);
    }

    public function delJobcv($condition)
    {
        return db('jobcv')->where($condition)->delete();
    }

    public function getJobcvList($condition, $field = '*', $page = 0, $order = 'jobcv_addtime desc, jobcv_id desc', $limit = '')
    {
        if ($limit) {
            return db('jobcv')->where($condition)->field($field)->order($order)->page($page)->limit($limit)->select();
        } else {
            $res = db('jobcv')->where($condition)->field($field)->order($order)->paginate($page);
            $this->page_info = $res;
            return $res->items();
        }
    }

    public function getOneJobcv($condition, $field = '*')
    {
        return db('jobcv')->field($field)->where($condition)->find();
    }
}

?>
