LotteryMoneyLog.php 852 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Support\Facades\DB;
  4. /**
  5. *
  6. */
  7. class LotteryMoneyLog extends BaseModel {
  8. protected $table = "lottery_money_log";
  9. public $timestamps = false;
  10. function getlist($list = 10, $where = '') {
  11. $data = $this->orderBy('create_time', 'desc');
  12. if (!empty($where) && is_array($where)) {
  13. $data = $data->where($where);
  14. }
  15. $data = $data->paginate($list);
  16. if (!$data) {
  17. return -4010010022; //没有数据
  18. }
  19. return $data->toArray();
  20. }
  21. /**
  22. * 更新彩金记录状态
  23. * @param $data
  24. * @param $id
  25. * @return int
  26. */
  27. function updateSta($data,$id){
  28. $res = $this->where('id',$id)->update($data);
  29. if (!$res) {
  30. return -4010010022; //没有数据
  31. }
  32. return 1;
  33. }
  34. }