User_buyModel.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Models;
  3. class User_buyModel extends BaseModel {
  4. protected $table = 'money_buy';
  5. protected function getType() {
  6. return array(
  7. 'all' => trans('user_buy.all'), 'unclear' => trans('user_buy.unclear'), 'cleared' => trans('user_buy.cleared'),
  8. // 'rubish' => trans('user_buy.rubish'),
  9. );
  10. }
  11. function getTakelist($list = 20) {
  12. $data = $this->select('account_name', 'order_id', 'game_name', 'game_no', 'prize_note', 'money', 'prize_money', 'status', 'codes', 'water_status', 'money_time', 'get_money', 'prize', 'game_status')->orderBy('money_time', 'desc')->groupBy('account_name')->paginate($list);
  13. if (!$data) {
  14. return -7010100102; //没有列表数据
  15. }
  16. return $data->toArray();
  17. }
  18. function getAllBetAccount($where) {
  19. $model = $this->select('account_name');
  20. if (isset($where['in'])) {
  21. $model->whereIn('status', $where['in']);
  22. unset($where['in']);
  23. }
  24. if (!empty($where)) {
  25. $model->where($where);
  26. }
  27. $data = $model->groupBy('account_name')->get();
  28. if (!$data) {
  29. return -7010100202;
  30. }
  31. return $data->toArray();
  32. }
  33. //字段对应值
  34. private function getFeild($num) {
  35. $data = array(
  36. '1' => 'type',
  37. '2' => 'account_name',
  38. '3' => 'game_name',
  39. '4' => 'num',
  40. '5' => 'money',
  41. '6' => 'prize_money',
  42. '7' => 'get_money',
  43. );
  44. return $data[$num];
  45. }
  46. }