|
@@ -155,7 +155,7 @@ class Facility extends Api
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->field($field)
|
|
->field($field)
|
|
|
->cache(true,86400)
|
|
->cache(true,86400)
|
|
|
- ->order('提交时间 desc')
|
|
|
|
|
|
|
+// ->order('提交时间 desc')
|
|
|
->select();
|
|
->select();
|
|
|
if (empty($list)){
|
|
if (empty($list)){
|
|
|
$this->success('未找到检验记录');
|
|
$this->success('未找到检验记录');
|
|
@@ -169,14 +169,13 @@ class Facility extends Api
|
|
|
}
|
|
}
|
|
|
$data['item'] = array_unique($data['item']);
|
|
$data['item'] = array_unique($data['item']);
|
|
|
$data['InspectionTime'] = array_values(array_unique($data['InspectionTime']));
|
|
$data['InspectionTime'] = array_values(array_unique($data['InspectionTime']));
|
|
|
- $data['工单编号'] = array_unique($data['工单编号']);
|
|
|
|
|
|
|
+ $data['工单编号'] = array_values(array_unique($data['工单编号']));
|
|
|
foreach ($data['工单编号'] as $key => $value){
|
|
foreach ($data['工单编号'] as $key => $value){
|
|
|
foreach ($data['item'] as $k=>$v){
|
|
foreach ($data['item'] as $k=>$v){
|
|
|
$time = '';
|
|
$time = '';
|
|
|
foreach ($list as $kk=>$vv){
|
|
foreach ($list as $kk=>$vv){
|
|
|
if ($vv['工单编号'] === $value && $vv['检验项目'] === $v){
|
|
if ($vv['工单编号'] === $value && $vv['检验项目'] === $v){
|
|
|
$time = $time.date('H:i',strtotime($vv['提交时间'])).',';
|
|
$time = $time.date('H:i',strtotime($vv['提交时间'])).',';
|
|
|
-
|
|
|
|
|
$data['row'][$key][$k] = [
|
|
$data['row'][$key][$k] = [
|
|
|
'工单编号' => $value,
|
|
'工单编号' => $value,
|
|
|
'印件号' => $vv['印件号'],
|
|
'印件号' => $vv['印件号'],
|
|
@@ -235,8 +234,6 @@ class Facility extends Api
|
|
|
AND b.Gy0_sj1 <> '1900-01-01 00:00:00'
|
|
AND b.Gy0_sj1 <> '1900-01-01 00:00:00'
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
a.Gd_gdbh
|
|
a.Gd_gdbh
|
|
|
- ORDER BY
|
|
|
|
|
- b.Gy0_sj1
|
|
|
|
|
LIMIT 1";
|
|
LIMIT 1";
|
|
|
$list = Db::query($sql);
|
|
$list = Db::query($sql);
|
|
|
if (empty($list)){
|
|
if (empty($list)){
|
|
@@ -451,11 +448,8 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
-// $lastUniqid = \db('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
-// $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
|
|
$name = \db('工单_基本资料')->where('Gd_gdbh',$workOrder)->field('rtrim(Gd_cpmc) as productName')->find();
|
|
$name = \db('工单_基本资料')->where('Gd_gdbh',$workOrder)->field('rtrim(Gd_cpmc) as productName')->find();
|
|
|
$where = [
|
|
$where = [
|
|
|
-// 'UniqId' => ['>',$startUniqid],
|
|
|
|
|
'sczl_gdbh' => $workOrder,
|
|
'sczl_gdbh' => $workOrder,
|
|
|
'sczl_jtbh' => $machine,
|
|
'sczl_jtbh' => $machine,
|
|
|
'sczl_cl' => ['<>',0.0],
|
|
'sczl_cl' => ['<>',0.0],
|