Money_buy_match.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. *------Create thems Model------
  4. *------SCWPHP Version 1.0.0------
  5. *------Dev Model Jions------
  6. *------Create Time 2017-06-13 18:45:24------
  7. */
  8. namespace App\Commons\Model;
  9. use \System\Model;
  10. class Money_buy_match extends Model {
  11. protected $table = 'money_buy_match';
  12. public function getByDetail($Detailid){
  13. $ret = $this->where('money_buy_detail_id' ,$Detailid)->find();
  14. return $ret;
  15. }
  16. public function getByTypeMatch($type,$matchId){
  17. $rets = $this->where(['game_code'=>$type,'match_id'=>$matchId])->find();
  18. return $rets;
  19. }
  20. //查找某个订单下是否还有未处理完的订单情况
  21. public function FindByTypeOrderResult($type,$OrderId,$result=0){
  22. if (is_string($result)){
  23. $ret = $this->where(['game_code'=>$type,'order_id'=>$OrderId,'result'=>$result])->find();
  24. }else{
  25. $ret = $this->where(['game_code'=>$type,'order_id'=>$OrderId])->whereIn('result',$result)->find();
  26. }
  27. return $ret;
  28. }
  29. public function getByBatchId($batch_id){
  30. $ret = $this->where('batch_id',$batch_id)->find();
  31. return $ret;
  32. }
  33. }