LifeFarmOrderDetail.php 748 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\admin\model;
  3. use app\admin\controller\life\FarmGoods;
  4. use support\Db;
  5. use support\Model;
  6. /**
  7. * 绿色蔬菜订单详情
  8. * Class Order
  9. * @package app\admin\model
  10. */
  11. class LifeFarmOrderDetail extends Model
  12. {
  13. /**
  14. *
  15. * The table associated with the model.
  16. *
  17. * @var string
  18. */
  19. protected $table = 'life_farm_order_detail';
  20. public $timestamps = false;
  21. public function getDetailCreateTimeAttribute($value)
  22. {
  23. return date('Y-m-d H:i:s', $value);
  24. }
  25. public function Goods(){
  26. return $this->belongsTo(LifeFarmGoods::class,'detail_goods_id','goods_id');
  27. }
  28. public function User(){
  29. return $this->belongsTo(User::class,'detail_user_id','user_id');
  30. }
  31. }