FarmHarvestLog.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Module\Farm\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\HasMany;
  5. /**
  6. * 收获记录模型
  7. * field start
  8. * @property int $id 主键ID
  9. * @property int $user_id 用户ID
  10. * @property int $land_id 土地ID
  11. * @property int $crop_id 作物ID
  12. * @property int $seed_id 种子ID
  13. * @property int $output_amount 产出数量
  14. * @property string $harvest_time 收获时间
  15. * @property \Carbon\Carbon $created_at 创建时间
  16. * field end
  17. */
  18. class FarmHarvestLog extends Model
  19. {
  20. /**
  21. * 与模型关联的表名
  22. *
  23. * @var string
  24. */
  25. protected $table = 'farm_harvest_logs';
  26. /**
  27. * 可批量赋值的属性
  28. *
  29. * @var array
  30. */
  31. protected $fillable = [
  32. 'user_id',
  33. 'land_id',
  34. 'crop_id',
  35. 'seed_id',
  36. 'output_amount',
  37. 'harvest_time',
  38. ];
  39. /**
  40. * 应该被转换为日期的属性
  41. *
  42. * @var array
  43. */
  44. protected $dates = [
  45. 'harvest_time',
  46. 'created_at',
  47. ];
  48. /**
  49. * 表明模型是否应该被打上时间戳
  50. *
  51. * @var bool
  52. */
  53. public $timestamps = false;
  54. }