<?php

namespace app\model;

use think\Db;
use think\Model;

/**
 * Created by PhpStorm.
 * User : zw
 * Date : 2018/2/1
 * Time : 13:32
 * Intro:
 */
class OMarchInModel extends Model
{
    protected $table = "o_march_in";
    private $db_model;

    function __construct()
    {
        $this->db_model = Db::name($this->table);
    }

    /**
     * 新增跟进信息
     * @param $params
     * @return int
     */
    public function addMarchIn($params)
    {
        $params["create_time"] = date("Y-m-d H:i:s", time());
        $params["update_time"] = date("Y-m-d H:i:s", time());
        Db::startTrans();
        try {
            $this->db->inser($params);
            Db::commit();
            return 1;
        } catch (\Exception $e) {
            Db::rollback();
            return 0;
        }
    }

}