Revert "fix:质检发货资料相关修复"

This reverts commit 913a017f3d.
This commit is contained in:
miguannan
2026-05-21 19:39:28 +08:00
parent 913a017f3d
commit ddf31f3fbe
5 changed files with 364 additions and 538 deletions

View File

@@ -55,7 +55,6 @@ class Material extends Common
$insert_info['create_time'] = $param['create_time'];
db('materials_info')->insert($insert_info);
return $this->sendSuccess('添加成功');
}
@@ -80,44 +79,24 @@ class Material extends Common
//项目基础信息
else if (1 == $param['materials_class'] )
{
$currPage = empty($param['currPage']) ? 1 : $param['currPage'];
$pageSize = empty($param['pageSize']) ? 10 : $param['pageSize'];
$countQuery = db('materials_info')->alias('p')
->where('p.materials_class', $param['materials_class'])
->where('p.materials_owner', $param['materials_owner']);
$listQuery = db('materials_info')->alias('p')
$MaterialsInfoList = db('materials_info')
->alias('p')
->join('materials_type s', 's.type_id = p.materials_type', 'left')
->where('p.materials_class', $param['materials_class'])
->where('p.materials_owner', $param['materials_owner']);
if (!empty($param['materials_type'])) {
if (is_array($param['materials_type'])) {
$countQuery->whereIn('p.materials_type', $param['materials_type']);
$listQuery->whereIn('p.materials_type', $param['materials_type']);
} else {
$countQuery->where('p.materials_type', $param['materials_type']);
$listQuery->where('p.materials_type', $param['materials_type']);
}
if (isset($param['materials_type']) && is_array($param['materials_type']) && count($param['materials_type']) > 0) {
$MaterialsInfoList->whereIn('p.materials_type', $param['materials_type']);
} elseif (isset($param['materials_type'])) {
$MaterialsInfoList->where('p.materials_type', $param['materials_type']);
}
if (!empty($param['start_time'])) {
$countQuery->where('p.create_time', '>=', $param['start_time']);
$listQuery->where('p.create_time', '>=', $param['start_time']);
}
if (!empty($param['end_time'])) {
$countQuery->where('p.create_time', '<=', $param['end_time']);
$listQuery->where('p.create_time', '<=', $param['end_time']);
}
$total = $countQuery->count();
$list = $listQuery
->page($currPage, $pageSize)
$MaterialsInfoList = $MaterialsInfoList
->order('p.create_time desc')
->field('p.*, s.type_name as materials_type_name')
->select();
return $this->sendSuccess(['list' => $list, 'total' => $total]);
return $this->sendSuccess($MaterialsInfoList);
}
//问题单信息

View File

@@ -56,7 +56,7 @@ class Role extends Common
$results = db('system_router')->alias('router')
->join('system_role', 'system_role.router_id = router.id OR system_role.router_id LIKE concat(router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id) OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\')', 'LEFT')
->field('router.*, GROUP_CONCAT(system_role.role_name) as roles')
->group('router.id')
->group('router.path')
->select();
$this->sendSuccess($results);
}

View File

@@ -54,7 +54,6 @@ class Material extends Common
$insert_info['create_time'] = $param['create_time'];
db('materials_info')->insert($insert_info);
return $this->sendSuccess('添加成功');
}
@@ -79,38 +78,15 @@ class Material extends Common
//项目基础信息
else if (1 == $param['materials_class'] )
{
$currPage = empty($param['currPage']) ? 1 : $param['currPage'];
$pageSize = empty($param['pageSize']) ? 10 : $param['pageSize'];
$countQuery = db('materials_info')->alias('p')
->where('p.materials_class', $param['materials_class'])
->where('p.materials_owner', $param['materials_owner']);
$listQuery = db('materials_info')->alias('p')
->join('materials_type s', 's.type_id = p.materials_type', 'left')
->where('p.materials_class', $param['materials_class'])
->where('p.materials_owner', $param['materials_owner']);
if (!empty($param['materials_type'])) {
$countQuery->where('p.materials_type', $param['materials_type']);
$listQuery->where('p.materials_type', $param['materials_type']);
}
if (!empty($param['start_time'])) {
$countQuery->where('p.create_time', '>=', $param['start_time']);
$listQuery->where('p.create_time', '>=', $param['start_time']);
}
if (!empty($param['end_time'])) {
$countQuery->where('p.create_time', '<=', $param['end_time']);
$listQuery->where('p.create_time', '<=', $param['end_time']);
}
$total = $countQuery->count();
$list = $listQuery
->page($currPage, $pageSize)
->order('p.create_time desc')
->field('p.*, s.type_name as materials_type_name')
->select();
return $this->sendSuccess(['list' => $list, 'total' => $total]);
$MaterialsInfoList = db('materials_info')->alias('p')
->join('materials_type s', 's.type_id =p.materials_type', 'left')
->where('p.materials_class', $param['materials_class'])
->where('p.materials_owner', $param['materials_owner'])
->where('p.materials_type', $param['materials_type'])
->order('p.create_time desc')
->field('p.*, s.type_name as materials_type_name')
->select();
return $this->sendSuccess($MaterialsInfoList);
}
//问题单信息

View File

@@ -56,7 +56,7 @@ class Role extends Common
$results = db('system_router')->alias('router')
->join('system_role', 'system_role.router_id = router.id OR system_role.router_id LIKE concat(router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id) OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\')', 'LEFT')
->field('router.*, GROUP_CONCAT(system_role.role_name) as roles')
->group('router.id')
->group('router.path')
->select();
$this->sendSuccess($results);
}