hasOne(TaskTemplate::class, 'id', 'template_id')->bind(['template_name'=>'title']); } public function templateInfo() { return $this->hasOne(TaskTemplate::class, 'id', 'template_id'); } public function company() { return $this->hasOne(Company::class, 'id', 'company_id')->field('id,day_count,user_id'); } public function scheduling(){ return $this->hasOne(TaskScheduling::class,'id','scheduling_id'); } public function settlement($id=0){ TaskSchedulingPlan::where('id', $id)->update(['is_pay' => 1]); } }