LotteryMoney.php 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Support\Facades\DB;
  4. /**
  5. *
  6. */
  7. class LotteryMoney extends BaseModel {
  8. protected $table = "lottery_money";
  9. public $timestamps = false;
  10. function getlist($list = 10, $where = '') {
  11. $data = $this->orderBy('sort', '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. public function getLotteryList(){
  22. $data = $this->orderBy('sort', 'desc')->get();
  23. if (!$data) {
  24. return -4010010022; //没有数据
  25. }
  26. return $data->toArray();
  27. }
  28. public function gLotteryList($type){
  29. $data = $this->select('type')->where('type',$type)->first();
  30. if (!$data) {
  31. return -4010010022; //没有数据
  32. }
  33. return $data->toArray();
  34. }
  35. }