LhcOrder.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Models;
  3. use App\Models\LhcLottery;
  4. use App\Models\LhcOrderItem;
  5. class LhcOrder extends BaseModel
  6. {
  7. protected $table = 'lhc_order';
  8. protected $fillable = ['issue','ordernum','member_id','game','gameplay','number','odds','amount','lottery_status','win_amount','profit_and_loss','is_faker','remark','type'];
  9. protected $hidden = [];
  10. public $timestamps = true;
  11. protected $dateFormat = 'U'; // U 代表 UNIX 时间戳(int)
  12. const STATUS_STAY = 0; // 待开奖
  13. const STATUS_LOSS = 1; // 未中奖
  14. const STATUS_WIN = 2; // 已中奖
  15. const STATUS_REFUND = 3; // 已退款
  16. public function lottery()
  17. {
  18. return $this->belongsTo(LhcLottery::class, 'issue', 'issue')
  19. ->select('issue', 'type', 'open_code', 'open_time', 'is_settlement');
  20. }
  21. public function items() {
  22. return $this->hasMany(LhcOrderItem::class, 'ordernum', 'ordernum');
  23. }
  24. public static function getRemark($type)
  25. {
  26. if ($type == 1) {
  27. return '新澳门六合彩';
  28. } elseif ($type == 2) {
  29. return '香港六合彩';
  30. } elseif ($type == 3) {
  31. return '澳门六合彩';
  32. } elseif ($type == 4) {
  33. return '极速六合彩';
  34. } elseif ($type == 5) {
  35. return '加拿大28';
  36. } elseif ($type == 6) {
  37. return '极速28';
  38. } elseif ($type == 7) {
  39. return '极速赛车';
  40. } elseif ($type == 8) {
  41. return '极速时时彩';
  42. } elseif ($type == 9) {
  43. return '极速飞艇';
  44. } elseif ($type == 10) {
  45. return 'SG时时彩';
  46. } elseif ($type == 11) {
  47. return 'SG飞艇';
  48. } elseif ($type == 12) {
  49. return '极速快3';
  50. } elseif ($type == 13) {
  51. return 'SG快3';
  52. }
  53. return '';
  54. }
  55. }