| 1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Models;
- class Btrecord extends BaseModel {
- protected $table = "btrecord";
- public $timestamps = false;
- function getlist($list = 10, $where = '') {
- $data = $this->orderBy('time', 'desc');
- if (!empty($where) && is_array($where)) {
- $data = $data->where($where);
- }
- $data = $data->paginate($list);
- if (!$data) {
- return -3010010102; //没有数据
- }
- return $data->toArray();
- }
-
- function updateMsg($data, $id) {
- $res = $this->where('id', $id)->update($data);
- if (!$res) {
- return -4010011122;
- }
- return 1;
- }
-
- }
|