GameSfsixlottery_Buy.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Models;
  3. class GameSfsixlottery_Buy extends BaseModel
  4. {
  5. public $num=3;//开奖号码个数
  6. protected $table="game_sfsixlottery_buy";
  7. public $timestamps = false;
  8. //撤单
  9. function Cancel($where){
  10. $res=$this->where($where)->where('status',0)->update(['delstatus'=>2]);
  11. if($res){
  12. return -5051262422;//作废失败
  13. }
  14. return 1;
  15. }
  16. function cancel_order($order_id){
  17. $res=$this->where('order_id',$order_id)->update(['delstatus'=>2]);
  18. if(!$res){
  19. return -7021021122;
  20. }
  21. return 1;
  22. }
  23. protected function getNoprizeInfo($info_no){
  24. $res=$this->where('no',$info_no)->where('prize_status',2)->first();
  25. if(!$res){
  26. return -5030010002;
  27. }
  28. return 1;
  29. }
  30. protected function getPrizeInfo($info_no){
  31. $res=$this->where('no',$info_no)->where('prize_status',1)->where('delstatus',1)->first();
  32. if(!$res){
  33. return -5030010302;
  34. }
  35. return 1;
  36. }
  37. protected function getBuyprizeInfo($info_no){
  38. $res=$this->where('no',$info_no)->where('prize_status',1)->first();
  39. if(!$res){
  40. return -5030010202;
  41. }
  42. return 1;
  43. }
  44. //修改可重新开奖注单状态
  45. protected function updatePrizeinfo($info_no){
  46. $res=$this->where('no',$info_no)->update(['prize_status'=>1]);
  47. if(!$res){
  48. return -5030010102;
  49. }
  50. return $this->where('no',$info_no)->where('delstatus',1)->count();
  51. }
  52. //重置
  53. protected function reSet($no){
  54. $res=$this->where('no',$no)->update(['status'=>0,'prize_status'=>1]);
  55. if(!$res){
  56. return -30081;
  57. }
  58. return 1;
  59. }
  60. }