<?php
/**
 * 管理后台操作记录
 *
 * @author sun
 */
class OperateRecord {
    
    //城市别名
    private $city;
    
    //关联的表名
    private $table;
    
    public function __construct($db_sys, $city) {
        $this->table = 'operate_record';
        $this->db_sys = $db_sys;
        $this->city = $city;
    }
    
    public  function insertData($channel, $behavior, $description, $operator) {
        if ($channel == '' || $behavior == '' 
            || $description == '' || $operator == '') {
            return false;
        }
        $arrFiledValues = array();
        $arrFiledValues['channel'] = $channel;
        $arrFiledValues['behavior'] = $behavior;
        $arrFiledValues['description'] = $description;
        $arrFiledValues['operator'] = $operator;
        $arrFiledValues['ip'] = GetIp();
        $arrFiledValues['city'] = $this->city;
        $sql = SqlCombinHelper::insert_sql($this->table, $arrFiledValues);
        return $this->db_sys->execute($sql);
    }
}
