|
|
@@ -31,17 +31,17 @@ class Facility extends Api
|
|
|
$this->error('请求错误');
|
|
|
}
|
|
|
$data = [];
|
|
|
- $department = Db::table('设备_基本资料')->distinct(true)->column('使用部门');
|
|
|
+ $department = \db('设备_基本资料')->distinct(true)->column('使用部门');
|
|
|
$date = date('Y-m-d H:i:s',time()-3888000);
|
|
|
if (empty($department)){
|
|
|
$this->error('未获取到机台数据');
|
|
|
}
|
|
|
foreach ($department as $value){
|
|
|
if (rtrim($value) !== '研发中心'){
|
|
|
- $machine = Db::table('设备_基本资料')->where('使用部门',$value)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
+ $machine = \db('设备_基本资料')->where('使用部门',$value)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
foreach ($machine as $kk=>$vv){
|
|
|
if ($vv['设备编号'] !== 'ZH01#'){
|
|
|
- $date = Db::table('设备_产量计酬')
|
|
|
+ $date = \db('设备_产量计酬')
|
|
|
->where('sczl_jtbh',$vv['设备编号'])
|
|
|
// ->where('sczl_rq','> time',$date)
|
|
|
->distinct(true)
|
|
|
@@ -87,15 +87,15 @@ class Facility extends Api
|
|
|
sczl_bh3,sczl_bh4,sczl_bh5,sczl_bh6,sczl_bh7,sczl_bh8,sczl_bh9,sczl_bh10,sczl_rate1,sczl_rate2,sczl_rate3,sczl_rate4,sczl_rate5,sczl_rate6,sczl_rate7,
|
|
|
sczl_rate8,sczl_rate9,sczl_rate10';
|
|
|
//机台信息
|
|
|
- $machineDetail = Db::table('设备_基本资料')->where('设备编号',$machine)->field('rtrim(千件工价) as 千件工价,rtrim(日定额) as 日定额')->find();
|
|
|
+ $machineDetail = \db('设备_基本资料')->where('设备编号',$machine)->field('rtrim(千件工价) as 千件工价,rtrim(日定额) as 日定额')->find();
|
|
|
//工单编号
|
|
|
- $Gd_gdbh = Db::table('设备_产量计酬')->where($where)->distinct(true)->column('sczl_gdbh');
|
|
|
+ $Gd_gdbh = \db('设备_产量计酬')->where($where)->distinct(true)->column('sczl_gdbh');
|
|
|
//产品名称
|
|
|
- $productName = Db::table('工单_基本资料')->whereIn('Gd_gdbh',$Gd_gdbh)->column('Gd_cpmc','Gd_gdbh');
|
|
|
+ $productName = \db('工单_基本资料')->whereIn('Gd_gdbh',$Gd_gdbh)->column('Gd_cpmc','Gd_gdbh');
|
|
|
//组员信息
|
|
|
- $list = Db::table('设备_产量计酬')->where($where)->field($field)->select();
|
|
|
- $totalA = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
- $totalB = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
+ $list = \db('设备_产量计酬')->where($where)->field($field)->select();
|
|
|
+ $totalA = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
+ $totalB = \db('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
if (empty($list)){
|
|
|
$this->error('未找到机台数据');
|
|
|
}
|
|
|
@@ -110,7 +110,7 @@ class Facility extends Api
|
|
|
$list[$key]['日定额'] = $machineDetail['日定额'];
|
|
|
for ($i=1;$i<11;$i++){
|
|
|
if (isset($value['sczl_bh'.$i])){
|
|
|
- $name = Db::table('人事_基本资料')->where('员工编号',$value['sczl_bh'.$i])->field('rtrim(员工姓名) as name')->find();
|
|
|
+ $name = \db('人事_基本资料')->where('员工编号',$value['sczl_bh'.$i])->field('rtrim(员工姓名) as name')->find();
|
|
|
if (isset($name['name'])){
|
|
|
$list[$key]['组员'.$i] = $value['sczl_bh'.$i].$name['name'].'('.((float)$value['sczl_rate'.$i]*100).'%'.')';
|
|
|
}
|
|
|
@@ -144,33 +144,31 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($date)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
-// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
-// $startId = $last_id['UniqId']-1000000;
|
|
|
$where = [
|
|
|
'设备编号' => $machine,
|
|
|
'开工时间' => ['between',[date('Y-m-d 08:00:00',strtotime($date)),date('Y-m-d 08:00:00',strtotime($date)+86400)]],
|
|
|
'类别' => ['in',['IPQC检验','机台检验']],
|
|
|
// 'UniqId' => ['>',$startId],
|
|
|
];
|
|
|
- $begin = Db::table('制程检验_记录')->where($where)->field('UniqId')->find();
|
|
|
- $end = Db::table('制程检验_记录')->where($where)->order('UniqId desc')->field('UniqId')->find();
|
|
|
+ $begin = \db('制程检验_记录')->where($where)->field('UniqId')->find();
|
|
|
+ $end = \db('制程检验_记录')->where($where)->order('UniqId desc')->field('UniqId')->find();
|
|
|
$where['UniqId'] = ['between',[$begin['UniqId'],$end['UniqId']+1]];
|
|
|
//检验项目筛选
|
|
|
- $itemA = Db::table('制程检验_记录')->where($where)->distinct(true)->where('班组编号','A班')->column('rtrim(检验项目)');
|
|
|
- $itemB = Db::table('制程检验_记录')->where($where)->distinct(true)->where('班组编号','B班')->column('rtrim(检验项目)');
|
|
|
+ $itemA = \db('制程检验_记录')->where($where)->distinct(true)->where('班组编号','A班')->column('rtrim(检验项目)');
|
|
|
+ $itemB = \db('制程检验_记录')->where($where)->distinct(true)->where('班组编号','B班')->column('rtrim(检验项目)');
|
|
|
//检验时间
|
|
|
- $InspectionTime = Db::table('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
|
|
|
+ $InspectionTime = \db('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
|
|
|
foreach ($InspectionTime as $k=>$v){
|
|
|
$InspectionTime[$k] = date('H:i',strtotime($v));
|
|
|
}
|
|
|
//检测记录详情
|
|
|
$field = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称';
|
|
|
- $nameDetailA = Db::table('制程检验_记录')->where($where)->field($field)->where('班组编号','A班')->find();
|
|
|
- $nameDetailB = Db::table('制程检验_记录')->where($where)->field($field)->where('班组编号','B班')->find();
|
|
|
+ $nameDetailA = \db('制程检验_记录')->where($where)->field($field)->where('班组编号','A班')->find();
|
|
|
+ $nameDetailB = \db('制程检验_记录')->where($where)->field($field)->where('班组编号','B班')->find();
|
|
|
$list = $data1 = $data2 = [];
|
|
|
//A班检测数据
|
|
|
foreach ($itemA as $key=>$value){
|
|
|
- $SubmissionTime = Db::table('制程检验_记录')->where($where)
|
|
|
+ $SubmissionTime = \db('制程检验_记录')->where($where)
|
|
|
->where('班组编号','A班')
|
|
|
->where('检验项目',$value)
|
|
|
->where('检验结果','合格')
|
|
|
@@ -190,7 +188,7 @@ class Facility extends Api
|
|
|
}
|
|
|
//B班数据详情
|
|
|
foreach ($itemB as $key=>$value){
|
|
|
- $SubmissionTime = Db::table('制程检验_记录')->where($where)
|
|
|
+ $SubmissionTime = \db('制程检验_记录')->where($where)
|
|
|
->where('班组编号','B班')
|
|
|
->where('检验项目',$value)
|
|
|
->where('检验结果','合格')
|
|
|
@@ -367,16 +365,16 @@ class Facility extends Api
|
|
|
if (empty($workOrder)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
-// $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
+// $lastUniqid = \db('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
// $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
//右边工艺及完成数量
|
|
|
- $Process = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
+ $Process = \db('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
// ->where('UniqId','>',$startUniqid)
|
|
|
->distinct(true)->order('sczl_gxh')
|
|
|
->column('sczl_gxh');
|
|
|
$data = [];
|
|
|
foreach ($Process as $k=>$v){
|
|
|
- $res= Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
+ $res= \db('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
// ->where('UniqId','>',$startUniqid)
|
|
|
->where('sczl_gxh',$v)
|
|
|
->field('rtrim(sczl_yjno) as sczl_yjno,rtrim(sczl_gxmc) as sczl_gxmc')
|
|
|
@@ -385,7 +383,7 @@ class Facility extends Api
|
|
|
$res['sczl_yjno'] = '0'.$res['sczl_yjno'];
|
|
|
}
|
|
|
$processList['process'] = $res['sczl_yjno'].'-'.$res['sczl_gxmc'];
|
|
|
- $processList['completed'] = Db::table('设备_产量计酬')
|
|
|
+ $processList['completed'] = \db('设备_产量计酬')
|
|
|
->where('sczl_gdbh',$workOrder)
|
|
|
// ->where('UniqId','>',$startUniqid)
|
|
|
->where('sczl_gxh',$v)
|
|
|
@@ -423,12 +421,12 @@ class Facility extends Api
|
|
|
rtrim(sczl_bh10) as bh10,rtrim(sczl_rate1) as rate1,rtrim(sczl_rate2) as rate2,rtrim(sczl_rate3) as rate3,rtrim(sczl_rate4) as rate4,
|
|
|
rtrim(sczl_rate5) as rate5,rtrim(sczl_rate6) as rate6,rtrim(sczl_rate7) as rate7,rtrim(sczl_rate8) as rate8,
|
|
|
rtrim(sczl_rate9) as rate9,rtrim(sczl_rate10) as rate10,rtrim(UniqId) as ID';
|
|
|
- $team = Db::table('设备_产量计酬')
|
|
|
+ $team = \db('设备_产量计酬')
|
|
|
->where('sczl_jtbh',$machine)
|
|
|
->field($field)
|
|
|
->order('UniqId desc')
|
|
|
->find();
|
|
|
- $list = Db::table('设备_班组资料')->where($where)->field($field)->select();
|
|
|
+ $list = \db('设备_班组资料')->where($where)->field($field)->select();
|
|
|
$data = [];
|
|
|
foreach ($list as $k=>$v){
|
|
|
if ($team == $v){
|
|
|
@@ -440,7 +438,7 @@ class Facility extends Api
|
|
|
$data[$k]['班组号'] = $v['班组号'];
|
|
|
for ($i=1;$i<11;$i++){
|
|
|
if ($v['bh'.$i] != '' && $v['bh'.$i] != '000000'){
|
|
|
- $name = Db::table('人事_基本资料')->where('员工编号',$v['bh'.$i])->field('rtrim(员工姓名) as 姓名')->find();
|
|
|
+ $name = \db('人事_基本资料')->where('员工编号',$v['bh'.$i])->field('rtrim(员工姓名) as 姓名')->find();
|
|
|
$data[$k][$i-1] = $v['bh'.$i].' '.$name['姓名'].' ('.number_format($v['rate'.$i]*100,2).'%'.')';
|
|
|
}
|
|
|
}
|
|
|
@@ -471,9 +469,9 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
-// $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
+// $lastUniqid = \db('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
// $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
- $name = Db::table('工单_基本资料')->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 = [
|
|
|
// 'UniqId' => ['>',$startUniqid],
|
|
|
'sczl_gdbh' => $workOrder,
|
|
|
@@ -486,7 +484,7 @@ class Facility extends Api
|
|
|
rtrim(sczl_保养工时) as 保养工时,rtrim(sczl_打样工时) as 打样工时,rtrim(sczl_异常停机工时) as 异常停机工时,rtrim(sczl_设备运行工时) as 通电工时,
|
|
|
rtrim(码开始行) as 码开始行,rtrim(码结束行) as 码结束行,rtrim(码包) as 码包,rtrim(主电表) as 主电表,rtrim(辅电表) as 辅电表,rtrim(sczl_ms) as 色度,
|
|
|
rtrim(sczl_sj1) as sj1,rtrim(sczl_sj2) as sj2';
|
|
|
- $list = Db::table('设备_产量计酬')->where($where)->field($field)->order('UniqId desc')->select();
|
|
|
+ $list = \db('设备_产量计酬')->where($where)->field($field)->order('UniqId desc')->select();
|
|
|
if (empty($list)){
|
|
|
$this->error('未找到生产记录');
|
|
|
}
|
|
|
@@ -503,7 +501,7 @@ class Facility extends Api
|
|
|
SUM(sczl_来料少数) as 来料异常,SUM(sczl_装版工时) as 装版工时,SUM(sczl_保养工时) as 保养工时,SUM(sczl_打样工时) as 打样工时,
|
|
|
SUM(sczl_异常停机工时) as 异常停机工时,SUM(sczl_设备运行工时) as 通电工时,SUM(码开始行) as 码开始行,SUM(码结束行) as 码结束行,
|
|
|
SUM(码包) as 码包,SUM(主电表) as 主电表,SUM(辅电表) as 辅电表';
|
|
|
- $total = Db::table('设备_产量计酬')->where($where)->field($field1)->order('UniqId desc')->select();
|
|
|
+ $total = \db('设备_产量计酬')->where($where)->field($field1)->order('UniqId desc')->select();
|
|
|
$total[0]['版数'] = count($list);
|
|
|
$list['total'] = $total[0];
|
|
|
$this->success('成功',$list);
|
|
|
@@ -531,7 +529,7 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
-// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
+// $last_id = \db('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
// $startId = $last_id['UniqId']-100000;
|
|
|
$where = [
|
|
|
'设备编号' => $machine,
|
|
|
@@ -541,19 +539,19 @@ class Facility extends Api
|
|
|
// 'UniqId' => ['>',$startId],
|
|
|
];
|
|
|
//检验项目筛选
|
|
|
- $item = Db::table('制程检验_记录')->where($where)->distinct(true)->column('rtrim(检验项目)');
|
|
|
+ $item = \db('制程检验_记录')->where($where)->distinct(true)->column('rtrim(检验项目)');
|
|
|
//检验时间
|
|
|
- $InspectionTime = Db::table('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
|
|
|
+ $InspectionTime = \db('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
|
|
|
foreach ($InspectionTime as $k=>$v){
|
|
|
$InspectionTime[$k] = date('H:i',strtotime($v));
|
|
|
}
|
|
|
//检测记录详情
|
|
|
$field = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称';
|
|
|
- $nameDetail = Db::table('制程检验_记录')->where($where)->field($field)->find();
|
|
|
+ $nameDetail = \db('制程检验_记录')->where($where)->field($field)->find();
|
|
|
$data = [];
|
|
|
//检测数据
|
|
|
foreach ($item as $key=>$value){
|
|
|
- $SubmissionTime = Db::table('制程检验_记录')->where($where)
|
|
|
+ $SubmissionTime = \db('制程检验_记录')->where($where)
|
|
|
->where('检验项目',$value)
|
|
|
->where('检验结果','合格')
|
|
|
->field('rtrim(提交时间) as 提交时间')
|
|
|
@@ -590,7 +588,7 @@ class Facility extends Api
|
|
|
rtrim(sczl_bh10) as sczl_bh10,rtrim(sczl_rate1) as sczl_rate1,rtrim(sczl_rate2) as sczl_rate2,rtrim(sczl_rate3) as sczl_rate3,rtrim(sczl_rate4) as sczl_rate4,
|
|
|
rtrim(sczl_rate5) as sczl_rate5,rtrim(sczl_rate6) as sczl_rate6,rtrim(sczl_rate7) as sczl_rate7,rtrim(sczl_rate8) as sczl_rate8,
|
|
|
rtrim(sczl_rate9) as sczl_rate9,rtrim(sczl_rate10) as sczl_rate10';
|
|
|
- $TeamList = Db::table('设备_班组资料')->where('UniqId',$data['ID'])->field($field)->find();
|
|
|
+ $TeamList = \db('设备_班组资料')->where('UniqId',$data['ID'])->field($field)->find();
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -605,7 +603,7 @@ class Facility extends Api
|
|
|
if ($this->request->isGet() === false){
|
|
|
$this->error('请求错误');
|
|
|
}
|
|
|
- $list = Db::table('设备_基本资料')->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
+ $list = \db('设备_基本资料')->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
if (empty($list)){
|
|
|
$this->error('未找到机台编号');
|
|
|
}
|
|
|
@@ -633,7 +631,7 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
- $res = Db::table('设备_班组资料')
|
|
|
+ $res = \db('设备_班组资料')
|
|
|
->where('UniqId',$param['UniqId'])
|
|
|
->delete();
|
|
|
if ($res !== false){
|
|
|
@@ -676,10 +674,13 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
-// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
-// $startId = $last_id['UniqId']-100000;
|
|
|
$date = date('Y-m-d H:i:s',time());
|
|
|
- $startTime = date('Y-m-d 08:30:00',time());
|
|
|
+ if (empty($param['start'])){
|
|
|
+ $startTime = date('Y-m-d 08:30:00',time());
|
|
|
+ }else{
|
|
|
+ $startTime = $param['start'];
|
|
|
+ }
|
|
|
+
|
|
|
if ($date<$startTime){
|
|
|
$startTime = date('Y-m-d H:i:s',strtotime($startTime)-86400);
|
|
|
}
|
|
|
@@ -692,10 +693,8 @@ class Facility extends Api
|
|
|
$filed = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称,rtrim(流程单号) as 流程单号,
|
|
|
rtrim(设备编号) as 设备编号,rtrim(班组编号) as 班组编号,rtrim(检验项目) as 现场管理人员,rtrim(检验备注) as 检验备注,
|
|
|
rtrim(提交时间) as 提交时间,rtrim(开工时间) as 开工时间';
|
|
|
- $list = Db::table('制程检验_记录')->where($where)
|
|
|
-// ->where('UniqId','>',$startId)
|
|
|
+ $list = \db('制程检验_记录')->where($where)
|
|
|
->field($filed)
|
|
|
-// ->fetchSql(true)
|
|
|
->select();
|
|
|
if (empty($list)){
|
|
|
$this->error('未找到该工单当前班次巡检记录');
|
|
|
@@ -753,9 +752,9 @@ class Facility extends Api
|
|
|
'sys_id' => '',
|
|
|
'sys_rq' => date('Y-m-d H:i:s',time()),
|
|
|
'mod_rq' => '',
|
|
|
- 'UniqId' => Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find()['UniqId']+1
|
|
|
+ 'UniqId' => \db('制程检验_记录')->order('UniqId desc')->field('UniqId')->find()['UniqId']+1
|
|
|
];
|
|
|
- $sql = Db::table('制程检验_记录')->fetchSql(true)->insert($data);
|
|
|
+ $sql = \db('制程检验_记录')->fetchSql(true)->insert($data);
|
|
|
$res = Db::query($sql);
|
|
|
if ($res !== false){
|
|
|
$this->success('成功');
|
|
|
@@ -779,7 +778,7 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
- $list = Db::table('设备_点检项目')
|
|
|
+ $list = \db('设备_点检项目')
|
|
|
->where('适用机型','LIKE','%;'.$param['machine'].';%')
|
|
|
->distinct(true)
|
|
|
->column('部件名称','部件编号');
|
|
|
@@ -807,7 +806,7 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
- $list = Db::table('设备_点检项目')
|
|
|
+ $list = \db('设备_点检项目')
|
|
|
->where('部件名称',$param['unitName'])
|
|
|
->field('rtrim(检验项目) as 检验项目,rtrim(判定标准) as 判定标准,rtrim(点检方法) as 点检方法')
|
|
|
->select();
|
|
|
@@ -836,10 +835,15 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
- $lastId = 10000000;
|
|
|
+ $lastNumber = \db("设备_点检记录")->field('Uniqid as ID')->order('Uniqid desc')->find()['ID'];
|
|
|
+ if ((int)$lastNumber>10000000){
|
|
|
+ $lastId = $lastNumber;
|
|
|
+ }else{
|
|
|
+ $lastId = 10000000;
|
|
|
+ }
|
|
|
$row = [];
|
|
|
foreach ($param as $key=>$value){
|
|
|
- $unitCode = Db::table('设备_点检项目')->where('部件名称',$value['unitName'])->field('rtrim(部件编号) as 部件编号')->find();
|
|
|
+ $unitCode = \db('设备_点检项目')->where('部件名称',$value['unitName'])->field('rtrim(部件编号) as 部件编号')->find();
|
|
|
$row[$key] = [
|
|
|
'日期' => date('Y-m-d 00:00:00',time()),
|
|
|
'班组编号' => $value['team'],
|
|
|
@@ -858,7 +862,7 @@ class Facility extends Api
|
|
|
];
|
|
|
|
|
|
}
|
|
|
- $sql = Db::table('设备_点检记录')->fetchSql(true)->insertAll($row);
|
|
|
+ $sql = \db('设备_点检记录')->fetchSql(true)->insertAll($row);
|
|
|
$res = Db::query($sql);
|
|
|
if ($res !== false){
|
|
|
$this->success('成功');
|
|
|
@@ -952,7 +956,7 @@ class Facility extends Api
|
|
|
}
|
|
|
$date = date('Y-m-d 00:00:00',time()-3888000);
|
|
|
$nowTime = date('Y-m-d H:i:s',time());
|
|
|
- $list = Db::table('设备_基本资料')->where('使用状态',1)->order('设备编号')->column('设备编号');
|
|
|
+ $list = \db('设备_基本资料')->where('使用状态',1)->order('设备编号')->column('设备编号');
|
|
|
if (empty($list)){
|
|
|
$this->error('失败');
|
|
|
}
|
|
|
@@ -1002,13 +1006,13 @@ class Facility extends Api
|
|
|
rtrim(码包号A) as 码包号A,rtrim(工单编号B) as 工单编号B,rtrim(印件工序B) as 印件工序B,rtrim(码包号B) as 码包B,
|
|
|
rtrim(清场项目A) as 项目1,rtrim(清场项目B) as 项目2,rtrim(清场项目C) as 项目3,rtrim(清场项目D) as 项目4,rtrim(清场项目E) as 项目5,
|
|
|
rtrim(机长) as 机长,rtrim(班长) as 班长,rtrim(质量巡查员) as 质量巡查员';
|
|
|
- $list = Db::table('制程_换型清场')->where('UniqId',$param['UniqId'])->field($field)->find();
|
|
|
+ $list = \db('制程_换型清场')->where('UniqId',$param['UniqId'])->field($field)->find();
|
|
|
if (empty($list)){
|
|
|
$this->error('未找到该条清场记录');
|
|
|
}
|
|
|
$list['日期'] = date('Y-m-d',strtotime($list['日期']));
|
|
|
- $list['印件名称A'] = Db::table('工单_印件资料')->where('Yj_Gdbh',$list['工单编号A'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
- $list['印件名称B'] = Db::table('工单_印件资料')->where('Yj_Gdbh',$list['工单编号B'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
+ $list['印件名称A'] = \db('工单_印件资料')->where('Yj_Gdbh',$list['工单编号A'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
+ $list['印件名称B'] = \db('工单_印件资料')->where('Yj_Gdbh',$list['工单编号B'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
|
|
|
$this->success('成功',$list);
|
|
|
}
|
|
|
|
|
|
@@ -1024,7 +1028,10 @@ class Facility extends Api
|
|
|
}
|
|
|
$date = date('Y-m-d 00:00:00',time()-3888000);
|
|
|
$nowTime = date('Y-m-d H:i:s',time());
|
|
|
+ $where = [
|
|
|
+ '日期' =>['between',[$nowTime,$date]],
|
|
|
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
//
|