更新合同

This commit is contained in:
yaooo 2023-12-13 14:36:46 +08:00
parent 9cdd866799
commit b41294a3ea
4 changed files with 14 additions and 6 deletions

View File

@ -162,6 +162,7 @@ class SubcontractingContractLogic extends BaseLogic
{
$subcontractingContract = SubcontractingContract::findOrEmpty($params['id']);
$subcontractingContract->project = $subcontractingContract->project;
$subcontractingContract->work = $subcontractingContract->work;
return $subcontractingContract->toArray();
}
}

View File

@ -115,6 +115,8 @@ class CustomContactsLogic extends BaseLogic
*/
public static function detail($params): array
{
return CustomContacts::with(['customName'])->findOrEmpty($params['id'])->toArray();
$customContacts = CustomContacts::findOrEmpty($params['id']);
$customContacts->custom = $customContacts->custom;
return $customContacts->toArray();
}
}

View File

@ -30,16 +30,16 @@ class SubcontractingContract extends BaseModel
protected $name = 'subcontracting_contract';
protected $deleteTime = 'delete_time';
public function project()
{
return $this->belongsTo(\app\common\model\project\Project::class, 'project_id');
}
public function getSigningDateAttr($value)
{
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
}
public function project()
{
return $this->belongsTo(\app\common\model\project\Project::class, 'project_id');
}
public function work()
{
return $this->hasMany(\app\common\model\contract\SubcontractingContractDetail::class, 'subcontracting_contract_id', 'id');

View File

@ -42,4 +42,9 @@ class CustomContacts extends BaseModel
return $this->hasOne(\app\common\model\custom\Custom::class, 'id', 'custom_id')->bind(['custom_name'=>'name']);
}
public function custom()
{
return $this->belongsTo(\app\common\model\custom\Custom::class, 'custom_id');
}
}