Merge pull request 'update' (#146) from zhangwei into dev

Reviewed-on: #146
This commit is contained in:
weiz 2024-01-10 15:05:57 +08:00
commit e66584e7f4
2 changed files with 4 additions and 3 deletions

View File

@ -66,7 +66,7 @@ class MaterialPurchaseRequestDetailLists extends BaseAdminDataLists implements L
$where[] = ['material_purchase_request_id','in',$material_purchase_request_ids];
}
return MaterialPurchaseRequestDetail::where($this->searchWhere)->where($where)
->field(['id', 'project_material_budget_detail_id', 'num'])
->field(['id', 'material_purchase_request_id', 'project_material_budget_detail_id', 'num'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($data){

View File

@ -118,12 +118,13 @@ class MaterialPurchaseRequestDetailLogic extends BaseLogic
public static function detail($params): array
{
$data = MaterialPurchaseRequestDetail::field('id,material_purchase_request_id,project_material_budget_detail_id,num')->findOrEmpty($params['id']);
$material_purchase_request = MaterialPurchaseRequest::field('project_id,apply_date,arrival_date')->where('id',$data['material_purchase_request_id'])->findOrEmpty();
$material_purchase_request = MaterialPurchaseRequest::field('material_purchase_request_code,project_id,apply_date,arrival_date')->where('id',$data['material_purchase_request_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$material_purchase_request['project_id'])->findOrEmpty();
$project_material_budget_detail = ProjectMaterialBudgetDetail::field('material_id')->where('id',$data['project_material_budget_detail_id'])->findOrEmpty();
$material = Material::field('first_level,second_level,three_level,name,code,specs,brand,parameter_description,unit')->where('id',$project_material_budget_detail['material_id'])->findOrEmpty();
$material_classify = MaterialClassify::where('id','in',[$material['first_level'],$material['second_level'],$material['three_level']])->column('name','id');
$data['project_name'] = $project['name'];
$data['material_purchase_request_code'] = $material_purchase_request['material_purchase_request_code'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$data['apply_date'] = $material_purchase_request['apply_date'];
$data['arrival_date'] = $material_purchase_request['arrival_date'];