<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class ShopInfo_model extends MY_Model{

    protected $table = 'score_shopinfo';
    protected $insert_filed = array('name', 'tel','phone', 'qq', 'addr', 'type','create_time','update_time');
    public function insert($data){
        $data['update_time'] = time();
        $data['create_time'] = time();
        return parent::insert($data);
    }

    public function update($data, $id){
        $data['update_time'] = time();
        $data = $this->check_insert($data);
        $this->db->where('id', $id);
        $this->db->update($this->table, $data);
        return $id;
    }

    public function getShopInfo(){
        return $this->db->get($this->table)->row_array();
    }
}