| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace App\Models;
- class GameDiceone extends BaseModel {
- protected $table = "game_diceone";
- public $timestamps = false;
- //获取往期开奖记录
- function getLog($list=20,$fild,$order,$where=''){
- $data=$this->orderBy($fild,$order);
- if(!empty($where)&&is_array($where)){
- $data = $data->where($where);
- }
- $data = $data->paginate($list);
- if(!$data){
- return -5040000622;//没有开奖数据
- }
- return $data->toArray();
- }
- //获取一个游戏开奖数据
- function getOne() {
- $data = $this->where('status', 2)->orderBy('open_time', 'desc')->first();
- if (!$data) {
- return -5040000622; //没有开奖数据
- }
- return $data->toArray();
- }
- //按期号获取游戏开奖号码
- function getPrizeCodes($no){
- $data=$this->where('info_no',$no)->first();
- if(!$data){
- return -5040100122;//没有该期信息
- }
- return $data->toArray();
- }
- //根据id获取订单信息
- function getInfoByID($id) {
- $data = $this->where('id', $id)->first();
- if (!$data) {
- return -5030001022; //没有订单数据
- }
- return $data->toArray();
- }
- //根据订单号获取订单信息
- function getInfoByOrderID($order_id) {
- $data = $this->where('order_id', $order_id)->first();
- if (!$data) {
- return -5030001022; //没有订单数据
- }
- return $data->toArray();
- }
- //管理员作废更新
- function updateStatus($order_id){
- $res=$this->where('order_id',$order_id)->update(['betstatus'=>2,'winmoney'=>0]);
- if(!$res){
- return -7021021122;
- }
- return 1;
- }
- }
|