MoneyBuySimplex.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Models;
  3. use DB;
  4. use App\Models\Stzqresult;
  5. use App\Models\Stlqresult;
  6. use App\Models\Stbqresult;
  7. use App\Models\Stwqresult;
  8. class MoneyBuySimplex extends BaseModel
  9. {
  10. protected $table = "money_buy_simplex";
  11. public $timestamps = false;
  12. //单式订单数据及比赛结果数据
  13. public function OrderinfoResult($order_id)
  14. {
  15. $Ordermodel = $this->where('order_id', $order_id)->first();
  16. if (empty($Ordermodel)) {
  17. return false;
  18. }
  19. $game_code = $Ordermodel->game_code;
  20. $match_id = $Ordermodel->match_id;
  21. switch ($game_code) {
  22. case 'zq':
  23. $model = new Stzqresult();
  24. break;
  25. case 'lq':
  26. $model = new Stlqresult();
  27. break;
  28. case 'bq':
  29. $model = new Stbqresult();
  30. break;
  31. default;
  32. $model = new Stwqresult();
  33. break;
  34. }
  35. $resultModel = $model->where([['match_id', '=', $match_id]])->first();
  36. return [
  37. 'order' => $Ordermodel,
  38. 'result' => $resultModel,
  39. ];
  40. }
  41. //一段时间内的提现人数
  42. public function countUser($timearea)
  43. {
  44. $data = $this->select('account_identity')->where('money_buy_simplex.status', '<>', 4)->join('account','money_buy_simplex.account_identity', '=', 'account.identity')->where('account.status','<>','4')->where('account.user_type','1')->whereBetween('money_time', $timearea)->groupBy('account_identity')->get();
  45. $data = $data->toArray();
  46. return $data;
  47. }
  48. }