|
|
@@ -955,15 +955,16 @@ class Facility extends Api
|
|
|
if ($this->request->isGet() === false){
|
|
|
$this->error('请求错误');
|
|
|
}
|
|
|
- $date = date('Y-m-d 00:00:00',time()-3888000);
|
|
|
+ $date = date('Y-m-d 00:00:00',time()-3456000);
|
|
|
$nowTime = date('Y-m-d H:i:s',time());
|
|
|
$list = \db('设备_基本资料')->where('使用状态',1)->order('设备编号')->column('设备编号');
|
|
|
if (empty($list)){
|
|
|
$this->error('失败');
|
|
|
}
|
|
|
- $sql = "SELECT RTRIM(a.`设备编号`) as `设备编号`,RTRIM(b.`日期`) as `日期`,RTRIM(b.UniqId) as UniqId FROM `设备_基本资料` as a
|
|
|
+ $sql = "SELECT RTRIM(a.`设备编号`) as `设备编号`,RTRIM(b.`日期`) as `日期`,RTRIM(b.UniqId) as UniqId
|
|
|
+ FROM `设备_基本资料` as a
|
|
|
LEFT JOIN `制程_换型清场` as b ON b.`机台编号` = a.`设备编号`
|
|
|
- WHERE b.`日期` > '{$date}' AND b.日期 < '{$nowTime}' ORDER BY b.`UniqId`";
|
|
|
+ WHERE b.`日期` > '{$date}' AND b.日期 < '{$nowTime}' AND b.`工单编号A` <> '' AND b.`工单编号B` <> '' ORDER BY b.`UniqId`";
|
|
|
$res = Db::query($sql);
|
|
|
$data = $result = [];
|
|
|
foreach ($list as $key=>$value){
|
|
|
@@ -1021,6 +1022,7 @@ class Facility extends Api
|
|
|
}
|
|
|
$list['日期'] = date('Y-m-d',strtotime($list['日期']));
|
|
|
$list['印件名称A'] = \db('工单_印件资料')->where('Yj_Gdbh',$list['工单编号A'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
+// if ()
|
|
|
$list['印件名称B'] = \db('工单_印件资料')->where('Yj_Gdbh',$list['工单编号B'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
$this->success('成功',$list);
|
|
|
}
|
|
|
@@ -1047,7 +1049,9 @@ class Facility extends Api
|
|
|
$nowTime = date('Y-m-d H:i:s',time());
|
|
|
$where = [
|
|
|
'日期' =>['between',[$date,$nowTime]],
|
|
|
- '机台编号' => $param['machine']
|
|
|
+ '机台编号' => $param['machine'],
|
|
|
+ '工单编号A' => ['<>',''],
|
|
|
+ '工单编号B' => ['<>',''],
|
|
|
];
|
|
|
$field = "rtrim(日期) as 日期,rtrim(机台编号) as 机台编号,rtrim(班组) as 班组,rtrim(工单编号A) as 工单编号A,rtrim(印件工序A) as 印件工序A,
|
|
|
rtrim(码包号A) as 码包号A,rtrim(工单编号B) as 工单编号B,rtrim(印件工序B) as 印件工序B,rtrim(码包号B) as 码包号B,rtrim(清场项目A) as 清场项目A,
|
|
|
@@ -1551,4 +1555,45 @@ class Facility extends Api
|
|
|
$this->success('设置成功');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //首页数据
|
|
|
+
|
|
|
+ public function index()
|
|
|
+ {
|
|
|
+ $data = [
|
|
|
+ 'workOrderData' => [
|
|
|
+ '计划中' => 100,
|
|
|
+ '排程中' => 100,
|
|
|
+ '制程中' => 100,
|
|
|
+ '已完工' => 100,
|
|
|
+ ],
|
|
|
+ 'MonthlyData' => [
|
|
|
+ '1' => 100,
|
|
|
+ '2' => 100,
|
|
|
+ '3' => 100,
|
|
|
+ '4' => 100,
|
|
|
+ '5' => 100,
|
|
|
+ '6' => 100,
|
|
|
+ '7' => 100,
|
|
|
+ '8' => 100,
|
|
|
+ '9' => 100,
|
|
|
+ '10' => 100,
|
|
|
+ '11' => 100,
|
|
|
+ '12' => 100,
|
|
|
+ ],
|
|
|
+ 'customer' => [
|
|
|
+ '0' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '1' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '2' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '3' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '4' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '5' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '6' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '7' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '8' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ '9' => ['包装用牛皮纸松,无法上高速机,烟厂手动加纸','2024-02-26'],
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ return json($data);
|
|
|
+ }
|
|
|
}
|