RechargeConfiguration.php 676 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. use App\Traits\ModelHelpers;
  4. use Illuminate\Database\Eloquent\Model;
  5. class RechargeConfiguration extends Model
  6. {
  7. //
  8. use ModelHelpers;
  9. protected $table = "recharge_configuration";
  10. protected $fillable = ['name', 'recharge_money', 'give_money', 'discount', 'admin_id', 'status', 'area_id', 'start_at', 'end_at'];
  11. const STATUS_OK = 1;
  12. const STATUS_NO = 0;
  13. public static $statusMaps = [
  14. self::STATUS_OK => '启用',
  15. self::STATUS_NO => '停用',
  16. ];
  17. public function areas()
  18. {
  19. return $this->belongsTo(
  20. Area::class,
  21. 'area_id',
  22. 'id'
  23. );
  24. }
  25. }