| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace App\Models;
- use DB;
- use App\Models\Stzqresult;
- use App\Models\Stlqresult;
- use App\Models\Stbqresult;
- use App\Models\Stwqresult;
- class MoneyBuySimplex extends BaseModel
- {
- protected $table = "money_buy_simplex";
- public $timestamps = false;
- //单式订单数据及比赛结果数据
- public function OrderinfoResult($order_id,$ScoreTitle='')
- {
- $Ordermodel = $this->where('order_id', $order_id)->first();
- if (empty($Ordermodel)) {
- return false;
- }
- // $odds_code = \App\Models\MoneyBuyMatch::where('batch_id',$Ordermodel->batch_id)->first();
- $odds_code = \App\Models\MoneyBuyMatch::where('order_id',$order_id)->first();
- $Ordermodel->odds_code = $odds_code->odds_code;
-
- $game_code = $Ordermodel->game_code;
- $match_id = $Ordermodel->match_id;
- switch ($game_code) {
- case 'zq':
- $model = new Stzqresult();
- $models = new \App\Models\Stzqleagueresult();
- break;
- case 'lq':
- $model = new Stlqresult();
- $models = new \App\Models\Stlqleagueresult();
- break;
- case 'bq':
- $model = new Stbqresult();
- $models = new \App\Models\Stbqleagueresult();
- break;
- default;
- $model = new Stwqresult();
- $models = new \App\Models\Stwqleagueresult();
- break;
- }
- $resultModel = $model->where([['match_id', '=', $match_id]])->first();
- $resultsModel = $models->where([['lg_id', '=', $match_id]])->first();
- if(empty($resultsModel)){
- $resultsModel['result'] = '';
- }
- //处理足球角球数据
- $corner_ball_json = $resultModel->corner_ball;
- return [
- 'order' => $Ordermodel,
- 'result' => $resultModel,
- 'results' => $resultsModel,
- ];
- }
- //一段时间内的提现人数
- public function countUser($timearea)
- {
- $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();
- $data = $data->toArray();
- return $data;
- }
- }
|