MexWarehouse.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Module\Mex\Models;
  3. use UCore\ModelCore;
  4. /**
  5. * 农贸市场系统仓库模型
  6. *
  7. * field start
  8. * @property int $id 记录ID,主键
  9. * @property int $item_id 商品ID,关联物品表
  10. * @property int $quantity 库存数量
  11. * @property float $total_buy_amount 累计买入金额
  12. * @property float $total_sell_amount 累计卖出金额
  13. * @property int $total_buy_quantity 累计买入数量
  14. * @property int $total_sell_quantity 累计卖出数量
  15. * @property \Carbon\Carbon $last_transaction_at 最后交易时间
  16. * @property \Carbon\Carbon $created_at 创建时间
  17. * @property \Carbon\Carbon $updated_at 更新时间
  18. * field end
  19. */
  20. class MexWarehouse extends ModelCore
  21. {
  22. protected $table = 'mex_warehouse';
  23. protected $fillable = [
  24. 'item_id',
  25. 'quantity',
  26. 'total_buy_amount',
  27. 'total_sell_amount',
  28. 'total_buy_quantity',
  29. 'total_sell_quantity',
  30. 'last_transaction_at',
  31. ];
  32. protected $casts = [
  33. 'item_id' => 'integer',
  34. 'quantity' => 'integer',
  35. 'total_buy_amount' => 'decimal:5',
  36. 'total_sell_amount' => 'decimal:5',
  37. 'total_buy_quantity' => 'integer',
  38. 'total_sell_quantity' => 'integer',
  39. 'last_transaction_at' => 'datetime',
  40. ];
  41. }