|
|
@@ -84,6 +84,8 @@ class OrganizationService extends Service
|
|
|
if(! empty($data['unit_list'])){
|
|
|
$unit = [];
|
|
|
foreach ($data['unit_list'] as $value){
|
|
|
+ if(empty($value['type'])) continue;
|
|
|
+ if(empty($value['unit'])) continue;
|
|
|
$unit[] = [
|
|
|
'organization_id' => $id,
|
|
|
'type' => $value['type'],
|
|
|
@@ -97,12 +99,13 @@ class OrganizationService extends Service
|
|
|
if(! empty($data['receipt_list'])){
|
|
|
$receipt = [];
|
|
|
foreach ($data['receipt_list'] as $value){
|
|
|
+ if(empty($value['type'])) continue;
|
|
|
if(empty($value['receipt'])) continue;
|
|
|
$receipt[] = [
|
|
|
'organization_id' => $id,
|
|
|
'type' => $value['type'],
|
|
|
'year' => $value['year'],
|
|
|
- 'receipt' => $value['receipt'],
|
|
|
+ 'receipt' => $value['receipt'] ?? '',
|
|
|
'crt_time' => $time,
|
|
|
];
|
|
|
}
|
|
|
@@ -112,12 +115,14 @@ class OrganizationService extends Service
|
|
|
if(! empty($data['requirement_list'])){
|
|
|
$requirement = [];
|
|
|
foreach ($data['requirement_list'] as $value){
|
|
|
+ if(empty($value['type'])) continue;
|
|
|
+ if(empty($value['requirement'])) continue;
|
|
|
$requirement[] = [
|
|
|
'organization_id' => $id,
|
|
|
'type' => $value['type'],
|
|
|
'requirement' => $value['requirement'],
|
|
|
- 'month_usage' => $value['month_usage'],
|
|
|
- 'reference_value' => $value['reference_value'],
|
|
|
+ 'month_usage' => $value['month_usage'] ?? '',
|
|
|
+ 'reference_value' => $value['reference_value'] ?? '',
|
|
|
'crt_time' => $time,
|
|
|
];
|
|
|
}
|
|
|
@@ -243,32 +248,32 @@ class OrganizationService extends Service
|
|
|
if(empty($data['type']) || ! isset(Organization::$type_name[$data['type']])) return [false, '组织类型错误'];
|
|
|
if(! empty($data['founding_time'])) $data['founding_time'] = $this->changeDateToDate($data['founding_time']);
|
|
|
|
|
|
- if(! empty($data['unit_list'])){
|
|
|
- foreach ($data['unit_list'] as $value){
|
|
|
- if(empty($value['type'])) return [false, '上下级单位类型不能为空'];
|
|
|
- if(empty($value['unit'])) return [false, '上下级单位名称不能为空'];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(! empty($data['receipt_list'])){
|
|
|
- foreach ($data['receipt_list'] as $value){
|
|
|
- if(empty($value['type'])) return [false, '营收信息类型不能为空'];
|
|
|
- if(empty($value['year'])) return [false, '营收年份不能为空'];
|
|
|
-// $start_time = strtotime($value['start_time'] . "-01");
|
|
|
-// $end_time = strtotime($value['end_time'] . "-01");
|
|
|
-// if(! $start_time) return [false, '营收日期范围错误'];
|
|
|
- if(empty($value['receipt'])) return [false, '营收数据不能为空'];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(! empty($data['requirement_list'])){
|
|
|
- foreach ($data['requirement_list'] as $value){
|
|
|
- if(empty($value['type'])) return [false, '需求信息类型不能为空'];
|
|
|
- if(empty($value['requirement'])) return [false, '需求信息名不能为空'];
|
|
|
- if(empty($value['month_usage'])) return [false, '月用量不能为空'];
|
|
|
- if(empty($value['reference_value'])) return [false, '参考价不能为空'];
|
|
|
- }
|
|
|
- }
|
|
|
+// if(! empty($data['unit_list'])){
|
|
|
+// foreach ($data['unit_list'] as $value){
|
|
|
+// if(empty($value['type'])) return [false, '上下级单位类型不能为空'];
|
|
|
+// if(empty($value['unit'])) return [false, '上下级单位名称不能为空'];
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// if(! empty($data['receipt_list'])){
|
|
|
+// foreach ($data['receipt_list'] as $value){
|
|
|
+// if(empty($value['type'])) return [false, '营收信息类型不能为空'];
|
|
|
+// if(empty($value['year'])) return [false, '营收年份不能为空'];
|
|
|
+//// $start_time = strtotime($value['start_time'] . "-01");
|
|
|
+//// $end_time = strtotime($value['end_time'] . "-01");
|
|
|
+//// if(! $start_time) return [false, '营收日期范围错误'];
|
|
|
+// if(empty($value['receipt'])) return [false, '营收数据不能为空'];
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// if(! empty($data['requirement_list'])){
|
|
|
+// foreach ($data['requirement_list'] as $value){
|
|
|
+// if(empty($value['type'])) return [false, '需求信息类型不能为空'];
|
|
|
+// if(empty($value['requirement'])) return [false, '需求信息名不能为空'];
|
|
|
+// if(empty($value['month_usage'])) return [false, '月用量不能为空'];
|
|
|
+// if(empty($value['reference_value'])) return [false, '参考价不能为空'];
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
if($is_add){
|
|
|
|