<?php
    /**
     * Created by PhpStorm.
     * User: blues
     * Date: 2018/10/30
     * Time: 15:09
     */

    namespace App\Models;


    class SystemAppupdate extends  BaseModel
    {
        protected $table = 'system_appupdate';
        public $timestamps = false;



        function getlist($where,$limit ){
            return  $this->where($where)
                ->limit($limit)->orderby('create_date','desc')
                ->get(['id','version_no','settype','download_url','update_num','status','other','create_date'])
                ->toArray();
        }

        function addRecord($data){
            $res=$this->insert($data);
            if(!$res){
                return -6030001222;
            }
        }

        function getIdData($id){
            return $this->where("id",$id)->first();
        }

        public function updateIdData(int  $id,$data){
            return $this->where("id",$id)->update($data);
        }
    }