| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833 |
- <?php
- /**
- *------Create thems Controller------
- *------SCWPHP Version 1.0.0------
- *------Dev Model Jions------
- *------Create Time 2017-06-19 18:04:54------
- */
- namespace App\Api\Controller;
- //ini_set('display_errors', 1);
- //
- //error_reporting(E_ALL);
- class UserDetails extends BaseController {
- /**
- * 用户明细列表
- * @return [type] [description]
- */
- public function MoneyList() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $res = $moneyClass->Winning($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * 资金流水订单详情
- * @return [type] [description]
- */
- public function MoneyDetail() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $order_id = isset($_REQUEST['order_id']) ? $_REQUEST['order_id'] : '';
- if (empty($order_id)) Render('', '-4046');
- $res = $moneyClass->MorderDetail($order_id);
- //echo $res;
- if ($res < 0) Render('', $res);
- Render($res, '1', 'success');
- }
- /**
- * 充值列表
- * @return [type] [description]
- */
- public function MoneyRecharge() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : '';
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : '';
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : '';
- $res = $moneyClass->Recharge($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * 提现列表
- * @return [type] [description]
- */
- public function MoneyTake() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : '';
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : '';
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : '';
- $res = $moneyClass->Withdrawals($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- //彩金升级记录
- public function cToUpgrade() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['create_time'] = isset($_POST['create_time']) ? $_POST['create_time'] : '';
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : '';
- $res = $moneyClass->cToUpgrade($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- //新增查询彩金记录
- public function getLotteryLog() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- if (empty($data['account_identity'])) {
- Render('', -4010, '缺少用户唯一标识');
- }
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : '';
- if (empty($data['time'])) {
- Render('', -4010, '缺少时间参数');
- }
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : 1;
- $log = $moneyClass->getLotteryLog($data);
- if ($log < 0) {
- Render('', $log, '获取数据失败');
- }
- Render($log, 1, '获取数据成功');
- }
- //彩金详细
- public function cToDetail() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['uid'] = isset($_POST['uid']) ? $_POST['uid'] : '';
- $data['money_type'] = isset($_POST['money_type']) ? $_POST['money_type'] : '';
- $res = $moneyClass->CToDetail($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- //充值明细新
- public function saveMoneyRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : '';
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : '';
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : '';
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : '';
- $res = $moneyClass->saveMoneyRecord($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- //提款明细新
- public function takeMoneyRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : '';
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : '';
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : '';
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : '';
- $res = $moneyClass->takeMoneyRecord($data);
- // dump($res);
- if (intval($res) < 0) {
- Render('',$res);
- }
- Render($res, '1', 'success');
- }
- /**
- * 充值列表
- * @return [type] [description]
- */
- public function PCMoneyRecharge() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['num1'] = isset($_POST['num1']) ? $_POST['num1'] : "";
- $data['num2'] = isset($_POST['num2']) ? $_POST['num2'] : "";
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $res = $moneyClass->PCRecharge($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * 提现列表
- * @return [type] [description]
- */
- public function PCMoneyTake() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['num1'] = isset($_POST['num1']) ? $_POST['num1'] : "";
- $data['num2'] = isset($_POST['num2']) ? $_POST['num2'] : "";
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $res = $moneyClass->PCWithdrawals($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * PC用户明细列表
- * @return [type] [description]
- */
- public function PCMoneyList() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['num1'] = isset($_POST['num1']) ? $_POST['num1'] : "";
- $data['num2'] = isset($_POST['num2']) ? $_POST['num2'] : "";
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['trade_type'] = isset($_POST['trade_type']) ? $_POST['trade_type'] : "";
- $res = $moneyClass->PcWinning($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- public function OGMoney() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $kyreturnMoney = 0;
- $ogreturnMoney = 0;
- $backMoney = 0;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $a = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : date('Y-m-d');
- if(empty($data['time'])){
- $data['time'] = date('Y-m-d');
- }
- $kywhere[] = array('GameEndTime','>=',$data['time'].' 00:00:00');
- $kywhere[] = array('GameEndTime','<=',$data['time'].' 23:59:59');
- $ogwheres[] = array('AddTime','>=',strtotime($data['time'].' 00:00:00'));
- $ogwheres[] = array('AddTime','<=',strtotime($data['time'].' 23:59:59'));
- $where[] = array('pass_time','>=',strtotime($data['time'].' 00:00:00'));
- $where[] = array('pass_time','<=',strtotime($data['time'].' 23:59:59'));
- $agwhere[] = array('recalcuTime','>=',strtotime($data['time'].' 00:00:00'));
- $agwhere[] = array('recalcuTime','<=',strtotime($data['time'].' 23:59:59'));
- $hjwhere[] = array('bet_time','>=',$data['time'].' 00:00:00');
- $hjwhere[] = array('bet_time','<=',$data['time'].' 23:59:59');
-
- $kybetting_money = lm("Kygame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($kywhere)->sum('CellScore');
- $ogbetting_money = lm("Oggame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($ogwheres)->sum('BettingAmount');
- //$agbetting_money = lm("Aggame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($agwhere)->sum('validBetAmount');
- $lcqpbetting_money = lm("Lcqpgame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($kywhere)->sum('CellScore');
- $lybetting_money = lm("Lygame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($kywhere)->sum('CellScore');
- $hjbetting_money = lm("Hjgame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where($hjwhere)->sum('bet_amount');
- $kywin_money = lm("Kygame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('Profit','>',0)->where($kywhere)->sum('Profit');
- $ogwin_money = lm("Oggame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('WinLoseAmount','>',0)->where($ogwheres)->sum('WinLoseAmount');
- //$agwin_money = lm("Aggame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('netAmount','>',0)->where($agwhere)->sum('netAmount');
- $lcqpwin_money = lm("Lcqpgame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('Profit','>',0)->where($kywhere)->sum('Profit');
- $lywin_money = lm("Lygame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('Profit','>',0)->where($kywhere)->sum('Profit');
- $hjwin_money = lm("Hjgame_betting_ogrbv", "commons")->where('account_identity',$data['account_identity'])->where('state',1)->where($hjwhere)->sum('profit');
- $ogreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Oggame')->where($where)->sum('money'); //返水金额
- $kyreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Kygame')->where($where)->sum('money'); //返水金额
- $lcqpreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Lcqpgame')->where($where)->sum('money');
- $lyreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Lygame')->where($where)->sum('money'); //返水金额
- //$agreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Kygame')->where($where)->sum('money'); //返水金额
- $hjreturnMoney = lm("Og_backwater", "commons")->where('account_identity',$data['account_identity'])->where('game_type','Hjgame')->where($where)->sum('money');
-
- $ogwin = $ogwin_money-$ogbetting_money;//赢亏
- $kywin = $kywin_money-$kybetting_money;//赢亏
- //$agwin = $agwin_money-$agbetting_money;//赢亏
- $lcqpwin = $lcqpwin_money-$lcqpbetting_money;//赢亏
- $lywin = $lywin_money-$lybetting_money;//赢亏
- $hjwin = $hjwin_money-$hjbetting_money;//赢亏
- if ($ogreturnMoney < 0) {
- $ogreturnMoney = 0;
- }
- if ($kyreturnMoney < 0) {
- $kyreturnMoney = 0;
- }
- if ($ogwin_money < 0) {
- $ogwin_money = 0;
- }
- if ($kywin_money < 0) {
- $kywin_money = 0;
- }
- if ($kybetting_money < 0) {
- $kybetting_money = 0;
- }
- if ($ogbetting_money < 0) {
- $ogbetting_money = 0;
- }
- // if ($agbetting_money < 0) {
- // $agbetting_money = 0;
- // }
- $lcqpbetting_money = ($lcqpbetting_money<0)? 0 : $lcqpbetting_money;
- $lybetting_money = ($lybetting_money<0)? 0 : $lybetting_money;
- // $data = lm('account_detailed', "Commons")->where('account_identity', $a)->first()->toArray();
- $dat = array(
- 'kywin_money' => sprintf("%.2f", $kywin_money),
- 'ogwin_money' => sprintf("%.2f", $ogwin_money),
- //'agwin_money' => sprintf("%.2f", $agwin_money),
- 'lcqpwin_money' => sprintf("%.2f", $lcqpwin_money),
- 'lywin_money' => sprintf("%.2f", $lywin_money),
- 'hjwin_money' => sprintf("%.2f", $hjwin_money),
-
- 'kybetting_money' => sprintf("%.2f", $kybetting_money),
- 'ogbetting_money' => sprintf("%.2f", $ogbetting_money),
- //'agbetting_money' => sprintf("%.2f", $agbetting_money),
- 'lcqpbetting_money' => sprintf("%.2f", $lcqpbetting_money),
- 'lybetting_money' => sprintf("%.2f", $lybetting_money),
- 'hjbetting_money' => sprintf("%.2f", $hjbetting_money),
-
-
- 'kyreturnMoney' => sprintf("%.2f", $kyreturnMoney),
- 'ogreturnMoney' => sprintf("%.2f", $ogreturnMoney),
- 'lcqpreturnMoney' => sprintf("%.2f", $lcqpreturnMoney),
- 'lyreturnMoney' => sprintf("%.2f", $lyreturnMoney),
- //'agreturnMoney' => sprintf("%.2f", $agreturnMoney),
- 'hjreturnMoney' => sprintf("%.2f", $hjreturnMoney),
-
- 'kywin' => sprintf("%.2f", $kywin),
- 'ogwin' => sprintf("%.2f", $ogwin),
- //'agwin' => sprintf("%.2f", $agwin),
- 'lcqpwin' => sprintf("%.2f", $lcqpwin),
- 'lywin' => sprintf("%.2f", $lywin),
- 'hjwin' => sprintf("%.2f", $hjwin),
- );
- Render($dat, '1', 'success');
- }
- /**
- * PC用户明细列表
- * @return [type] [description]
- */
- public function PCNewMoney() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $withdrawalsMoney = 0;
- $rechargeMoney = 0;
- $betMoney = 0;
- $winMoney = 0;
- $profitMoney = 0;
- $returnMoney = 0;
- $backMoney = 0;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $a = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['num1'] = isset($_POST['num1']) ? $_POST['num1'] : "";
- $data['num2'] = isset($_POST['num2']) ? $_POST['num2'] : "";
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : date('Y-m-d');//qtx 2018-12-25
- if(empty($data['time'])){//qtx 2018-12-25
- $data['time'] = date('Y-m-d');
- }
- $withdrawalsMoney = $moneyClass->PCRecharge($data, 1); //充值金额
- $rechargeMoney = $moneyClass->PCWithdrawals($data, 1); //提现金额
- $backMoney = $moneyClass->backWaterMoney($data, 1); //回水金额
- $returnMoney = $moneyClass->returnMoney($data, 3); //返水金额
- if ($backMoney < 0) {
- $backMoney = 0;
- }
- if ($returnMoney < 0) {
- $returnMoney = 0;
- }
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['start'] = isset($_POST['start']) ? $_POST['start'] : "";
- $data['end'] = isset($_POST['end']) ? $_POST['end'] : "";
- $data['time'] = isset($_POST['time']) ? $_POST['time'] : date('Y-m-d');//qtx 2018-12-25
- if(empty($data['time'])){//qtx 2018-12-25
- $data['time'] = date('Y-m-d');
- }
- //dump($data);
- $resMoney = $moneyClass->EffectiveBetting($data, 1);
- $sixresMoney = $moneyClass->EffectivesixBetting($data, 1);
- $data = lm('account_detailed', "Commons")->where('account_identity', $a)->first()->toArray();
- $dat = array(//qtx 2018-12-19
- 'withdrawalsMoney' => $withdrawalsMoney,
- 'rechargeMoney' => $rechargeMoney,
- 'cash' => $data['cash'],
- 'betMoney' => sprintf("%.2f", $resMoney['countMoney']),
- 'winMoney' => sprintf("%.2f", $resMoney['winMoney']),
- 'profitMoney' => sprintf("%.2f", $resMoney['profitMoney']),
- 'sumbet' => sprintf("%.2f", $resMoney['sumbet']),
- 'noawardbet' => sprintf("%.2f", $resMoney['noawardbet']),
- 'cancelbet' => sprintf("%.2f", $resMoney['cancelbet']),
- 'backMoney' => sprintf("%.2f", $backMoney),
- 'returnMoney' => sprintf("%.2f", $returnMoney),
- 'sixbetMoney' => sprintf("%.2f", $sixresMoney['sixcountMoney']),
- 'sixwinMoney' => sprintf("%.2f", $sixresMoney['sixwinMoney']),
- 'sixprofitMoney' => sprintf("%.2f", $sixresMoney['sixprofitMoney']),
- 'sixsumbet' => sprintf("%.2f", $sixresMoney['sixsumbet']),
- 'sixnoawardbet' => sprintf("%.2f", $sixresMoney['sixnoawardbet']),
- 'sixcancelbet' => sprintf("%.2f", $sixresMoney['sixcancelbet']),
- );
- Render($dat, '1', 'success');
- }
- /**
- * PC投注记录和追号记录
- * @return [type] [description]
- */
- public function PcBettingRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['money_time'] = isset($_POST['money_time']) ? $_POST['money_time'] : "";
- $data['time1'] = isset($_POST['time1']) ? $_POST['time1'] : "";
- $data['time2'] = isset($_POST['time2']) ? $_POST['time2'] : "";
- $data['no'] = isset($_POST['no']) ? $_POST['no'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : "";
- $res = $moneyClass->PcBettingRecord($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * PC投注记录和追号记录
- * @return [type] [description]
- */
- public function PcSixlotteryRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['money_time'] = isset($_POST['money_time']) ? $_POST['money_time'] : "";
- $data['time1'] = isset($_POST['time1']) ? $_POST['time1'] : "";
- $data['time2'] = isset($_POST['time2']) ? $_POST['time2'] : "";
- $data['no'] = isset($_POST['no']) ? $_POST['no'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : "";
- $res = $moneyClass->PcSixlotteryRecord($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * PC塞子游戏投注记录
- * @return [type] [description]
- */
- public function PcDiceBettingRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['money_time'] = isset($_POST['money_time']) ? $_POST['money_time'] : "";
- $data['time1'] = isset($_POST['time1']) ? $_POST['time1'] : "";
- $data['time2'] = isset($_POST['time2']) ? $_POST['time2'] : "";
- $data['no'] = isset($_POST['no']) ? $_POST['no'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : "";
- $res = $moneyClass->PcDiceBettingRecord($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- /**
- * PC投注记录和追号记录
- * @return [type] [description]
- */
- public function PcBettingDetails() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['money_time'] = isset($_POST['money_time']) ? $_POST['money_time'] : "";
- $data['time1'] = isset($_POST['time1']) ? $_POST['time1'] : "";
- $data['time2'] = isset($_POST['time2']) ? $_POST['time2'] : "";
- $data['no'] = isset($_POST['no']) ? $_POST['no'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : "";
- $res = $moneyClass->PcBettingDetails($data);
- $dat = $moneyClass->dataChange($res);
- //echo $res;
- Render($dat, '1', 'success');
- }
- /**
- * PC投注记录和追号记录
- * @return [type] [description]
- */
- public function PcSixlotteryDetails() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['money_time'] = isset($_POST['money_time']) ? $_POST['money_time'] : "";
- $data['time1'] = isset($_POST['time1']) ? $_POST['time1'] : "";
- $data['time2'] = isset($_POST['time2']) ? $_POST['time2'] : "";
- $data['no'] = isset($_POST['no']) ? $_POST['no'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $data['status'] = isset($_POST['status']) ? $_POST['status'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- $data['order_id'] = isset($_POST['order_id']) ? $_POST['order_id'] : "";
- $res = $moneyClass->PcSixlotteryDetails($data);
- $dat = $moneyClass->dataChange($res);
- //echo $res;
- Render($dat, '1', 'success');
- }
- /**
- * PC塞子投注详情
- * @return [type] [description]
- */
- public function PcDiceBettingDetails() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['game'] = isset($_POST['game']) ? $_POST['game'] : "";
- $data['game_name'] = isset($_POST['game_name']) ? $_POST['game_name'] : "";
- $data['id'] = isset($_POST['id']) ? $_POST['id'] : "";
- if ($data['game'] == 'dice') {
- $res = $moneyClass->DiceSdataChange($data);
- } else {
- $res = $moneyClass->DicedataChange($data);
- }
- Render($res, '1', 'success');
- }
- /*交易类型对应键值*/
- public function GetTradeType() {
- $child = array(
- '1' => '投注',
- '2' => '追号',
- '3' => '撤单',
- '4' => '中奖',
- '5' => '提现',
- '6' => '在线充值',
- '7' => '返水',
- '8' => '回水',
- '9' => '管理员扣款',
- '10' => '佣金提成',
- '11' => '后台充值',
- '12' => '活动',
- '13' => '充值赠送',
- '14' => '汇款',
- '15' => '提现冻结',
- '16' => '红包打赏',
- '19-1' => '额度转入',
- '19-2' => '额度转出',
- );
- $arr = array(
- '1' => array(
- 'name' => '全部',
- 'child' => $child,
- ),
- '2' => array(
- 'name' => '充值',
- 'child' => array(
- '11' => $child['11'],
- '6' => $child['6'],
- '14' => $child['14'],
- ),
- ),
- '3' => array(
- 'name' => '投注',
- 'child' => array(
- '1' => $child['1'],
- '2' => $child['2'],
- '3' => $child['3'],
- ),
- ),
- '4' => array(
- 'name' => '中奖',
- 'child' => array(
- '4' => $child['4'],
- ),
- ),
- '5' => array(
- 'name' => '提现',
- 'child' => array(
- '5' => $child['5'],
- '9' => $child['9'],
- ),
- ),
- '6' => array(
- 'name' => '额度转账',
- 'child' => array(
- '19-1' => $child['19-1'],
- '19-2' => $child['19-2'],
- ),
- ),
- '7' => array(
- 'name' => '活动优惠',
- 'child' => array(
- '7' => $child['7'],
- '8' => $child['8'],
- '10' => $child['10'],
- '13' => $child['13'],
- '12' => $child['12'],
- '16' => $child['16'],
- ),
- ),
- );
- Render($arr, '1', lang()->get('success'));
- }
- /**
- * 查询不同资金类型列表
- */
- public function Querry() {
- $status = isset($_POST['status']) ? $_POST['status'] : '';
- $trade_type = isset($_REQUEST['trade_type']) ? $_REQUEST['trade_type'] : '';
- $account_identity = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $page = isset($_POST['page']) ? $_POST['page'] : '1';
- $money_time = isset($_REQUEST['money_time']) ? $_REQUEST['money_time'] : '';
- $field = isset($_POST['field']) ? $_POST['field'] : 'otime';
- $orderby = isset($_REQUEST['orderby']) ? $_REQUEST['orderby'] : '2';
- $moneyClass = new \Biz\Money\MoneyQuery;
- if(empty($money_time)){//qtx 2018-12-25
- $prevmonth = date("Y-m-d", strtotime("-1 month"));
- $money_time = $prevmonth.'~'.date('Y-m-d');
- }
- $mtime = explode('~', $money_time);
- $data = array(
- 'account_identity' => $account_identity,
- 'status' => $status,
- 'trade_type' => $trade_type,
- 'page' => $page,
- 'field' => ($field == 'otime') ? 'money_time' : 'money',
- 'orderby' => ($orderby == 1) ? 'asc' : 'desc',
- 'money_time' => substr($money_time, '0', '19'),
- );
- if (count($mtime > 1)) {
- $data['money_time'] = $mtime;
- }
- $res = $moneyClass->Winning($data);
- //var_dump( $res);
- if (is_array($res)) {
- Render($res, '1', lang()->get('success'));
- } else {
- Render('', '-400', lang()->get('fail'));
- }
- }
- /*统计账户明细汇总*/
- public function AccountSum() {
- $trade_type = isset($_REQUEST['trade_type']) ? $_REQUEST['trade_type'] : '';
- $account_identity = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $page = isset($_POST['page']) ? $_POST['page'] : '1';
- $field = isset($_POST['field']) ? $_POST['field'] : 'otime';
- $orderby = isset($_POST['orderby']) ? $_POST['orderby'] : '2';
- $money_time = isset($_REQUEST['money_time']) ? $_REQUEST['money_time'] : '';
- $moneyClass = new \Biz\Money\MoneyQuery;
- $mtime = explode('~', $money_time);
- $data = array(
- 'account_identity' => $account_identity,
- 'trade_type' => $trade_type,
- 'page' => $page,
- 'money_time' => substr($money_time, '0', '19'),
- );
- if (count($mtime > 1)) {
- $data['money_time'] = $mtime;
- }
- $res = $moneyClass->AccountSum($data);
- //var_dump( $res);
- if (is_array($res)) {
- Render($res, '1', lang()->get('success'));
- } else {
- Render('', '-400', lang()->get('fail'));
- }
- }
- /**
- * 资金详情
- * @return [type] [description]
- */
- public function details() {
- $data['identity'] = isset($_GET['identity']) ? $_GET['identity'] : '';
- $moneyClass = new \Biz\Money\MoneyQuery;
- $res = $moneyClass->Lists($data);
- Render($res, '1', lang()->get('success'));
- }
- /**
- * 走势图
- * @return [type] [description]
- */
- public function TrendChart() {
- $nums = new \Biz\Game\GameQuery();
- $name = isset($_GET['name']) ? $_GET['name'] : '';
- $num1 = isset($_POST['num1']) ? $_POST['num1'] : '';
- $num2 = isset($_POST['num2']) ? $_POST['num2'] : '';
- $time = isset($_POST['time']) ? $_POST['time'] : '';
- $page = isset($_POST['page']) ? $_POST['page'] : '1'; //资金类型
- $limit = isset($_POST['limit']) ? $_POST['limit'] : '20';
- $datat = [
- 'name' => $name,
- 'num1' => $num1,
- 'num2' => $num2,
- 'time' => $time,
- 'page' => $page,
- 'limit' => $limit,
- ];
- $data = $nums->TrendChart($datat);
- $data['page']=$page;
- //dump(21);
- Render($data, '1', lang()->get('success'));
- }
- /**
- * 投注状态查询
- * @return [type] [description]
- */
- public function BetChart() {
- $nums = new \Biz\Money\MoneyQuery;
- $account_identity = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $game_name = isset($_GET['game_name']) ? $_GET['game_name'] : '';
- $no = isset($_POST['no']) ? $_POST['no'] : '';
- $status = isset($_POST['status']) ? $_POST['status'] : '0';
- $datat = [
- 'account_identity' => $account_identity,
- 'game_name' => $game_name,
- 'no' => $no,
- 'status' => $status,
- ];
- if (in_array($game_name, $this->curPrizeGame())) {
- $data = $nums->CurBetRecord($datat);
- } else {
- $data = $nums->NotBetRecord($datat);
- }
- //dump($data);
- Render($data, '1', lang()->get('success'));
- }
- //即时开奖游戏
- private function curPrizeGame() {
- return array(
- 'diceone',
- );
- }
- /**
- * 个人盈亏
- * @return [type] [description]
- */
- public function Personal() {
- $now_times = isset($_POST['now_time']) ? $_POST['now_time'] : '';
- //var_dump($now_times);
- $account_identity = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data = array(
- 'account_identity' => $account_identity,
- 'now_times' => $now_times,
- );
- $moneyClass = new \Biz\Money\MoneyQuery;
- $res = $moneyClass->Personal($data);
- Render($res, '1', lang()->get('success'));
- }
- public function test() {
- $money_type = isset($_POST['money_type']) ? $_POST['money_type'] : '';
- $status = isset($_POST['status']) ? $_POST['status'] : '1';
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = [
- 'account_identity' => 'ec4ad43d-6105-e90c-5f3e-38141676c3b6',
- //'money_type'=>$money_type,
- //'status'=>$status
- ];
- $res = $moneyClass->Winning($data);
- // dump($res);
- if (is_array($res)) {
- Render($res, '1', lang()->get('success'));
- } else {
- Render('', '-400', lang()->get('fail'));
- }
- }
- //快乐赛宝
- public function DiceDetails() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $moneyd = new \App\Api\Controller\Specgame;
- $data = array();
- $ta = $moneyd->GetOtherUser();
- $data['account_identity'] = isset($ta['other_user']['account_identity']) ? $ta['other_user']['account_identity'] : $_SESSION['uinfo']['account_identity'];
- $dat = $moneyClass->DiceBettingDetails($data);
- Render($dat, '1', 'success');
- }
- public function DiceOneDetails() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data = array();
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : $_SESSION['uinfo']['account_identity'];
- $dat = $moneyClass->DiceBettingDetails($data);
- Render($dat, '1', 'success');
- }
- //PC用户有效投注统计
- public function BettingRecord() {
- $moneyClass = new \Biz\Money\MoneyQuery;
- $data['account_identity'] = isset($_SESSION['uinfo']['account_identity']) ? $_SESSION['uinfo']['account_identity'] : '';
- $data['start'] = isset($_POST['start']) ? $_POST['start'] : "";
- $data['end'] = isset($_POST['end']) ? $_POST['end'] : "";
- $data['page'] = isset($_POST['page']) ? $_POST['page'] : "1";
- $res = $moneyClass->EffectiveBetting($data);
- //echo $res;
- Render($res, '1', 'success');
- }
- public function getFav() {
- $uuid = $_SESSION['uinfo']['identity'];
- $obj = lm('UserSetting', 'api')->where('account_identity', $uuid)->first(['fav_info']);
- $in = $obj ? json_decode($obj->fav_info) : [];
- $favs = lm('Game_type', 'commons')->whereIn('table_name', $in)->get(['name', 'table_name', 'icon']);
- Render($favs, 1);
- }
- public function setFav() {
- $uuid = $_SESSION['uinfo']['identity'];
- $type = intval($_POST['type'] ?? 1);
- $game_name = trim($_POST['game_name']);
- $obj = lm('UserSetting', 'api')->where('account_identity', $uuid)->first(['fav_info']);
- $data = $obj && $obj->fav_info != 'null' ? json_decode($obj->fav_info, 1) : [];
- if (intval($type) === 0) {
- if ($key = array_search($game_name, $data)) {
- array_splice($data, $key, 1);
- }
- } elseif ($type === 1) {
- if (!array_search($game_name, $data)) {
- array_push($data, $game_name);
- }
- }
- $ret = lm('UserSetting', 'api')->where('account_identity', $uuid)->update(['fav_info' => json_encode($data)]);
- if ($ret === 1) {
- $this->getFav();
- }
- Render('', -888, '操作失败');
- }
- }
|