<?php

namespace app\common\model;


use think\Model;

class Storenavigation extends Model
{
      protected static function init()
      {
          parent::init(); // TODO: Change the autogenerated stub
      }

    /**
     * 读取列表
     * @access public
     * @author csdeshang
     * @param type $condition 条件
     * @param type $field 字段
     * @return type
     */  
    public function getStorenavigationList($condition, $field='*') {
        $result = db('storenavigation')->field($field)->where($condition)->select();
        return $result;
    }

    /**
     * 读取单条记录
     * @access public
     * @author csdeshang
     * @param array $condition
     * @return array
     */
    public function getStorenavigationInfo($condition) {
        $result = db('storenavigation')->where($condition)->find();
        return $result;
    }

    /**
     * 增加
     * @access public
     * @author csdeshang
     * @param array $data 参数内容
     * @return bool
     */
    public function addStorenavigation($data){
        return db('storenavigation')->insertGetId($data);
    }

    /**
     * 更新
     * @access public
     * @author csdeshang 
     * @param array $update 更新数据
     * @param array $condition 条件
     * @return bool
     */
    public function editStorenavigation($update, $condition){
        return db('storenavigation')->where($condition)->update($update);
    }

    /**
     * 删除
     * @access public
     * @author csdeshang
     * @param array $condition 条件
     * @return bool
     */
    public function delStorenavigation($condition){
        return db('storenavigation')->where($condition)->delete();
    }
}