OwnerReport.php 823 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App;
  3. use App\Traits\ModelTimeFormat;
  4. use Illuminate\Database\Eloquent\Model;
  5. class OwnerReport extends Model
  6. {
  7. use ModelTimeFormat;
  8. protected $fillable = [
  9. "owner_id", //货主ID
  10. "counting_month", //结算月
  11. "daily_average_order_amount", //日均单量
  12. "current_month_counting_area", //结算月盘点面积
  13. "last_month_counting_area", //结算月上月盘点面积
  14. "owner_bill_report_id" //账单ID
  15. ];
  16. public $timestamps = false;
  17. public function owner()
  18. { //货主
  19. return $this->hasOne(Owner::class,"id","owner_id");
  20. }
  21. public function ownerBillReport()
  22. { //账单
  23. return $this->hasOne(OwnerBillReport::class,"id","owner_bill_report_id");
  24. }
  25. }