|
|
@@ -329,6 +329,13 @@ class Entrust extends Backend
|
|
|
*/
|
|
|
$data_txt = $entrust['sample_no'] . 'MS.D'; //如果是GCMS机台,数据文件为委托编号+MS.D或MSR.D
|
|
|
$gather_gcms = Db::name('gather_txt_gcms')->where('data_txt_name', ['=',$data_txt],['=',$entrust['sample_no'].'MSR.D'],'or')->order('id desc')->find();
|
|
|
+ /**
|
|
|
+ * 先都查找一边,按时间先后顺序判定哪个结果是最新的
|
|
|
+ * 1、gc和gcms都没有数据 返回错误->没获取到检测数据
|
|
|
+ * 2、gc或gcms中有一个有数据,判定这个数据为检测数据
|
|
|
+ * 3、gc和gcms都有数据,将创建时间转换为时间戳,判断大小,时间戳大的检测数据此委托单的检测数据
|
|
|
+ */
|
|
|
+
|
|
|
if (empty($gather_gcms)) {
|
|
|
$data_txt_gc = $entrust['sample_no'] . '.D';
|
|
|
$gather_gc = Db::name('gather_txt_gc')->where('data_txt_name', ['=',$data_txt_gc],['=',$entrust['sample_no'].'R.D'],'or')->order('id desc')->find();
|