master
cody 6 months ago
parent 6918a211c6
commit 0d255f15a1

@ -31,10 +31,13 @@ class Orders extends SoftDeletesModel
*/
public function needAgreements()
{
dd($this->paramedic_id
&& $this->project->agreement == 1
&& strtotime($this->created_at) >= strtotime(Orders::AGREEMENT_START_DATE));
if ($this->paramedic_id
&& $this->project->agreement == 1
&& strtotime($this->created_at) >= strtotime(Orders::AGREEMENT_START_DATE)
&& ($this->orderAgreements->isEmpty() || ($this->orderAgreements->isNotEmpty() && $this->orderAgreements[0]->paramedic_id != $this->paramedic_id))) {
&& ($this->orderAgreementByLast->isEmpty() || ($this->orderAgreementByLast->isNotEmpty() && $this->orderAgreementByLast->paramedic_id != $this->paramedic_id))) {
return 1;
}
return 0;

Loading…
Cancel
Save