Commit 4390267a authored by hujun's avatar hujun

model

parent ac31b77e
<?php
namespace app\model;
use think\Db;
use think\Model;
class FStoreData extends BaseModel
{
protected $table = 'f_store_data';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* 新增数据
* @param $data
* @return mixed
*/
public function saveOffice($data) {
$time = date("Y-m-d H:i:s", time());
$data["is_del"] = 0;
$data['create_time'] = $time;
$data['update_time'] = $time;
return $this->db_->insert($data);
}
/**
* 查询单条数据
* 朱伟 2018-10-18 10:41:10
*/
public function findByOne($field,$params) {
$result = $this->db_
->field($field)
->where($params)
->find();
return $result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment