Payment.php 740 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Models;
  3. class Payment extends BaseModel {
  4. protected $table = "system_bank";
  5. public $timestamps = false;
  6. function getInfos(){
  7. $data=$this->orderby('sort','desc')->whereIn('type', array(2,3,4,5,6,7))->get();
  8. if(!$data){
  9. return -6010000122;
  10. }
  11. return $data->toArray();
  12. }
  13. //更新设置
  14. function updateInfos($data,$id){
  15. $res=$this->where('id',$id)->update($data);
  16. if(!$res){
  17. return -7020050022;//更新失败
  18. }
  19. return 1;
  20. }
  21. //
  22. function upInfos($id){
  23. $res=$this->where('id',$id)->first();
  24. if(!$res){
  25. return -7020050022;//
  26. }
  27. return $res->toArray();
  28. }
  29. }