SystemAppupdate.php 957 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: blues
  5. * Date: 2018/10/30
  6. * Time: 15:09
  7. */
  8. namespace App\Models;
  9. class SystemAppupdate extends BaseModel
  10. {
  11. protected $table = 'system_appupdate';
  12. public $timestamps = false;
  13. function getlist($where,$limit ){
  14. return $this->where($where)
  15. ->limit($limit)->orderby('create_date','desc')
  16. ->get(['id','version_no','settype','download_url','update_num','status','other','create_date'])
  17. ->toArray();
  18. }
  19. function addRecord($data){
  20. $res=$this->insert($data);
  21. if(!$res){
  22. return -6030001222;
  23. }
  24. }
  25. function getIdData($id){
  26. return $this->where("id",$id)->first();
  27. }
  28. public function updateIdData(int $id,$data){
  29. return $this->where("id",$id)->update($data);
  30. }
  31. }