| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Models;
- class SettlementMiddleDetail extends BaseModel
- {
- protected $table = "settlement_middle_detail";
- public $timestamps = false;
- public function getSettledatas($gametype, $matchid, $bettype, $order_idsArr = [])
- {
- $ret = [];
- if (empty($order_idsArr)) {
- $his = $this->where([
- 'game_code' => $gametype,
- 'match_id' => $matchid,
- 'bet_type' => $bettype
- ])->get();
- } else {
- if ($bettype == 1) {
- $his = $this->where([
- 'game_code' => $gametype,
- 'match_id' => $matchid,
- 'bet_type' => $bettype
- ])->whereIn('order_id', $order_idsArr)->get();
- } else {
- $his = $this->where([
- 'game_code' => $gametype,
- 'bet_type' => $bettype
- ])->whereIn('order_id', $order_idsArr)->get();
- }
- }
- if (count($his) > 0) {
- foreach ($his as $val) {
- $ret[$val->order_id] = $val;
- }
- }
- return $ret;
- }
- }
|