Settings.php 505 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Models;
  3. class Settings extends BaseModel
  4. {
  5. protected $table="settings";
  6. public $timestamps = false;
  7. //获取所有菜单
  8. function getSet(){
  9. $data=$this->where('id',1)->first();
  10. if(!$data){
  11. return -6010000922;//没有数据
  12. }
  13. return $data->toArray();
  14. }
  15. function updateSet($data){
  16. $res=$this->where('id',1)->update($data);
  17. if(!$res){
  18. return -7020050022;
  19. }
  20. return 1;
  21. }
  22. }