|
|
@@ -23,6 +23,7 @@ class CostManagementService extends Service
|
|
|
$model->man_mark = $data['man_mark'] ?? '';
|
|
|
$model->mark = $data['mark'] ?? '';
|
|
|
$model->amount = $data['amount'] ?? 0;
|
|
|
+ $model->is_open = $data['is_open'] ?? 1;
|
|
|
$model->save();
|
|
|
|
|
|
DB::commit();
|
|
|
@@ -48,6 +49,8 @@ class CostManagementService extends Service
|
|
|
$model->mark = $data['mark'] ?? '';
|
|
|
$model->amount = $data['amount'] ?? 0;
|
|
|
$model->crt_id = $user['id'];
|
|
|
+ $model->is_open = $data['is_open'] ?? 1;
|
|
|
+
|
|
|
$model->save();
|
|
|
|
|
|
DB::commit();
|
|
|
@@ -112,6 +115,7 @@ class CostManagementService extends Service
|
|
|
|
|
|
if(! empty($data['man_mark'])) $model->where('man_mark', 'LIKE', '%'.$data['man_mark'].'%');
|
|
|
if(! empty($data['id'])) $model->whereIn('id', $data['id']);
|
|
|
+ if(isset($data['is_open'])) $model->where('is_open', $data['is_open']);
|
|
|
if(! empty($data['crt_time'][0]) && ! empty($data['crt_time'][1])) {
|
|
|
$return = $this->changeDateToTimeStampAboutRange($data['crt_time']);
|
|
|
$model->where('crt_time','>=',$return[0]);
|
|
|
@@ -137,6 +141,8 @@ class CostManagementService extends Service
|
|
|
if(empty($data['amount'])) return [false, '总金额不能为空'];
|
|
|
$res = $this->checkNumber($data['amount'],2,'positive');
|
|
|
if(! $res['valid']) return [false,'总金额:' . $res['error']];
|
|
|
+ if(! isset($data['is_open']) || ! isset(CostManagement::IS_OPEN_title[$data['is_open']])) return [false, '费用状态不能为空'];
|
|
|
+
|
|
|
if($is_add){
|
|
|
|
|
|
}else{
|
|
|
@@ -160,6 +166,7 @@ class CostManagementService extends Service
|
|
|
$data['data'][$key]['order_time'] = $value['order_time'] ? date('Y-m-d',$value['order_time']) : '';
|
|
|
$data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
|
|
|
$data['data'][$key]['customer_supply_title'] = $emp_2[$value['customer_supply_id']] ?? '';
|
|
|
+ $data['data'][$key]['is_open_title'] = CostManagement::IS_OPEN_title[$value['is_open']] ?? '';
|
|
|
}
|
|
|
|
|
|
return $data;
|