RewardCode.php 839 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class RewardCode extends Model
  5. {
  6. // Refer to Order model: use write connection and table agent.dbo.reward_codes
  7. protected $connection = 'write';
  8. protected $table = 'agent.dbo.reward_codes';
  9. protected $fillable = [
  10. 'code',
  11. 'expire_at',
  12. 'total_amount',
  13. 'min_amount',
  14. 'max_amount',
  15. 'total_count',
  16. 'claimed_count',
  17. 'claimed_amount',
  18. 'status',
  19. 'remark',
  20. ];
  21. protected $casts = [
  22. 'expire_at' => 'datetime',
  23. 'total_amount' => 'float',
  24. 'min_amount' => 'float',
  25. 'max_amount' => 'float',
  26. 'total_count' => 'integer',
  27. 'claimed_count' => 'integer',
  28. 'claimed_amount' => 'float',
  29. 'status' => 'integer',
  30. ];
  31. }