|
@@ -29,6 +29,45 @@ class Jcd
|
|
|
];
|
|
|
$result = (new JcdBus())->getModelItemBySampleID($data['sample_id']);
|
|
|
return showSuccess($result);
|
|
|
+ }
|
|
|
+
|
|
|
+ //上报检测单--是修改cyd中的test_status,0表示未检测,1表示已检测
|
|
|
+ public function upJcdItem()
|
|
|
+ {
|
|
|
+ $sample_id = request()->param('sample_id', '', 'trim');
|
|
|
+ $result = (new JcdBus())->upJcdItem($sample_id);
|
|
|
+ //返回一个undertake_id,前端要用这个刷新页面
|
|
|
+ $undertake_id = (new CydBus())->getCydItemBySampleId($sample_id);
|
|
|
+ return showSuccess($undertake_id[0]['undertake_id']);
|
|
|
+ }
|
|
|
|
|
|
+ //保存检测单
|
|
|
+ public function saveJcdItem()
|
|
|
+ {
|
|
|
+ $sample_id = request()->param('sample_id', '', 'trim');
|
|
|
+ $pesticides = request()->param('pesticides', '', 'trim');
|
|
|
+
|
|
|
+ $result = (new JcdBus())->saveJcdItem($sample_id, $pesticides);
|
|
|
+ return showSuccess($result);
|
|
|
}
|
|
|
+//
|
|
|
+// public function 123123(){
|
|
|
+// $data=$this->request->post();
|
|
|
+// $id = '';
|
|
|
+// $test_result=1;
|
|
|
+// $islog = Db::name('sample_pesticides')->where('sample_id',$data['sample_id'])->select();
|
|
|
+// if (count($islog)!=0){
|
|
|
+// return $this->jsonResponse(-1,'不要重复提交检测信息',$islog);
|
|
|
+// }
|
|
|
+// foreach ($data['pesticides'] as $k=>$v){
|
|
|
+// $v['sample_id']=$data['sample_id'];
|
|
|
+// $idv=Db::name('sample_pesticides')->insertGetId($v);
|
|
|
+// $id.=$idv.',';
|
|
|
+// if ($v['test_result']=='不合格'){
|
|
|
+// $test_result=0;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// $res=Db::name('cyd')->where('sample_id',$data['sample_id'])->update(['jc_value_id'=>$id,'test_result'=>$test_result]);
|
|
|
+// return $this->jsonSuccessData($res);
|
|
|
+// }
|
|
|
}
|