SettlementMiddleDetail.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Models;
  3. class SettlementMiddleDetail extends BaseModel
  4. {
  5. protected $table = "settlement_middle_detail";
  6. public $timestamps = false;
  7. public function getSettledatas($gametype, $matchid, $bettype, $order_idsArr = [])
  8. {
  9. $ret = [];
  10. if (empty($order_idsArr)) {
  11. $his = $this->where([
  12. 'game_code' => $gametype,
  13. 'match_id' => $matchid,
  14. 'bet_type' => $bettype
  15. ])->get();
  16. } else {
  17. if ($bettype == 1) {
  18. $his = $this->where([
  19. 'game_code' => $gametype,
  20. 'match_id' => $matchid,
  21. 'bet_type' => $bettype
  22. ])->whereIn('order_id', $order_idsArr)->get();
  23. } else {
  24. $his = $this->where([
  25. 'game_code' => $gametype,
  26. 'bet_type' => $bettype
  27. ])->whereIn('order_id', $order_idsArr)->get();
  28. }
  29. }
  30. if (count($his) > 0) {
  31. foreach ($his as $val) {
  32. $ret[$val->order_id] = $val;
  33. }
  34. }
  35. return $ret;
  36. }
  37. }