更新合同
This commit is contained in:
parent
9cdd866799
commit
b41294a3ea
@ -162,6 +162,7 @@ class SubcontractingContractLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$subcontractingContract = SubcontractingContract::findOrEmpty($params['id']);
|
$subcontractingContract = SubcontractingContract::findOrEmpty($params['id']);
|
||||||
$subcontractingContract->project = $subcontractingContract->project;
|
$subcontractingContract->project = $subcontractingContract->project;
|
||||||
|
$subcontractingContract->work = $subcontractingContract->work;
|
||||||
return $subcontractingContract->toArray();
|
return $subcontractingContract->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -115,6 +115,8 @@ class CustomContactsLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,16 +30,16 @@ class SubcontractingContract extends BaseModel
|
|||||||
protected $name = 'subcontracting_contract';
|
protected $name = 'subcontracting_contract';
|
||||||
protected $deleteTime = 'delete_time';
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
public function project()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(\app\common\model\project\Project::class, 'project_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSigningDateAttr($value)
|
public function getSigningDateAttr($value)
|
||||||
{
|
{
|
||||||
return empty($value) ? '' : date('Y-m-d H:i:s', $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()
|
public function work()
|
||||||
{
|
{
|
||||||
return $this->hasMany(\app\common\model\contract\SubcontractingContractDetail::class, 'subcontracting_contract_id', 'id');
|
return $this->hasMany(\app\common\model\contract\SubcontractingContractDetail::class, 'subcontracting_contract_id', 'id');
|
||||||
|
@ -42,4 +42,9 @@ class CustomContacts extends BaseModel
|
|||||||
return $this->hasOne(\app\common\model\custom\Custom::class, 'id', 'custom_id')->bind(['custom_name'=>'name']);
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user