Btrecord.php 563 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. class Btrecord extends BaseModel {
  4. protected $table = "btrecord";
  5. public $timestamps = false;
  6. function getlist($list = 10, $where = '') {
  7. $data = $this->orderBy('time', 'desc');
  8. if (!empty($where) && is_array($where)) {
  9. $data = $data->where($where);
  10. }
  11. $data = $data->paginate($list);
  12. if (!$data) {
  13. return -3010010102; //没有数据
  14. }
  15. return $data->toArray();
  16. }
  17. function updateMsg($data, $id) {
  18. $res = $this->where('id', $id)->update($data);
  19. if (!$res) {
  20. return -4010011122;
  21. }
  22. return 1;
  23. }
  24. }