| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- class OwnerAreaReport extends Model
- {
- protected $fillable = [
- "owner_id", //货主ID
- "counting_month", //结算月
- "area_on_tray", //货物整托
- "area_on_half_tray",//货物半托
- "area_on_flat", //平面区面积
- "accounting_area", //结算面积
- "status" //状态
- ];
- public function owner()
- { //货主
- return $this->hasOne(Owner::class,"id","owner_id");
- }
- /* 结算月格式转换,仅截取至月
- * 引用:CreateOwnerReport
- */
- public function getCountingMonthAttribute($value)
- {
- return substr($value,0,7);
- }
- }
|