This commit is contained in:
chenbo 2024-02-28 11:04:31 +08:00
parent 2a19b1ade3
commit d1c85499ba
6 changed files with 20 additions and 14 deletions
app
adminapi
common/model/project_process_management

@ -55,7 +55,8 @@ class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchIn
*/
public function lists(): array
{
return ProjectChangeVisa::where($this->searchWhere)
return ProjectChangeVisa::with(['projectInfo'])
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

@ -55,7 +55,8 @@ class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSea
*/
public function lists(): array
{
return ProjectSurveySignature::where($this->searchWhere)
return ProjectSurveySignature::with(['projectInfo'])
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

@ -110,6 +110,6 @@ class ProjectChangeVisaLogic extends BaseLogic
*/
public static function detail($params): array
{
return ProjectChangeVisa::findOrEmpty($params['id'])->toArray();
return ProjectChangeVisa::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
}
}

@ -41,10 +41,9 @@ class ProjectSurveySignatureLogic extends BaseLogic
Db::startTrans();
try {
ProjectSurveySignature::create([
'dataid' => $params['dataid'],
'num' => $params['num'],
'project' => $params['project'],
'project_num' => $params['project_num'],
'dataid' => generate_sn(ProjectSurveySignature::class, 'dataid'),
'num' => generate_sn(ProjectSurveySignature::class, 'num'),
'project_id' => $params['project_id'],
'wt_unit' => $params['wt_unit'],
'jsdw' => $params['jsdw'],
'bmfz' => $params['bmfz'],
@ -80,10 +79,7 @@ class ProjectSurveySignatureLogic extends BaseLogic
Db::startTrans();
try {
ProjectSurveySignature::where('id', $params['id'])->update([
'dataid' => $params['dataid'],
'num' => $params['num'],
'project' => $params['project'],
'project_num' => $params['project_num'],
'project_id' => $params['project_id'],
'wt_unit' => $params['wt_unit'],
'jsdw' => $params['jsdw'],
'bmfz' => $params['bmfz'],
@ -129,6 +125,6 @@ class ProjectSurveySignatureLogic extends BaseLogic
*/
public static function detail($params): array
{
return ProjectSurveySignature::findOrEmpty($params['id'])->toArray();
return ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
}
}

@ -16,6 +16,7 @@ namespace app\common\model\project_process_management;
use app\common\model\BaseModel;
use app\common\model\cost_project\CostProject;
use think\model\concern\SoftDelete;
@ -30,5 +31,8 @@ class ProjectChangeVisa extends BaseModel
protected $name = 'project_change_visa';
protected $deleteTime = 'delete_time';
public function projectInfo()
{
return $this->hasOne(CostProject::class, 'id', 'project_id');
}
}

@ -16,6 +16,7 @@ namespace app\common\model\project_process_management;
use app\common\model\BaseModel;
use app\common\model\cost_project\CostProject;
use think\model\concern\SoftDelete;
@ -30,5 +31,8 @@ class ProjectSurveySignature extends BaseModel
protected $name = 'project_survey_signature';
protected $deleteTime = 'delete_time';
public function projectInfo()
{
return $this->hasOne(CostProject::class, 'id', 'project_id');
}
}