|
|
@@ -62,9 +62,11 @@ class Inspect extends Api
|
|
|
}
|
|
|
$sql = 'SELECT DISTINCT sczl_gdbh FROM `db_手工检验` ORDER BY sczl_gdbh DESC LIMIT 65 ';
|
|
|
$list = Db::query($sql);
|
|
|
+
|
|
|
foreach ($list as $key => $value){
|
|
|
$dataCount = Db::name('db_手工检验')->alias('d')
|
|
|
->where('sczl_gdbh',$value['sczl_gdbh'])
|
|
|
+ ->where('SUBSTR(d.sczl_yjgx,1,2) = g.yj_Yjno')
|
|
|
->field('rtrim(d.sys_id) as sys_id, rtrim(g.yj_yjmc) as yj_yjmc')
|
|
|
->join(['工单_印件资料'=>'g'],'d.sczl_gdbh=g.Yj_Gdbh')
|
|
|
->order('sys_id asc')
|
|
|
@@ -75,6 +77,7 @@ class Inspect extends Api
|
|
|
$sysIds = array_column($dataCount, 'sys_id');
|
|
|
//统计每个不同的 sys_id 的数量
|
|
|
$counts = array_count_values($sysIds);
|
|
|
+
|
|
|
$i = 0;
|
|
|
foreach ($counts as $k=>$v){
|
|
|
$list[$key]['sys'][$i]['sys_id'] = $k;
|
|
|
@@ -125,7 +128,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->limit($limit)->page($pages)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
|
|
|
$count = Db::name('db_手工检验')->where($option)->count();
|
|
|
@@ -167,7 +170,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where('a.sczl_gdbh',$gdbh)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->limit($limit)->page($pages)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
|
|
|
$count = Db::name('db_手工检验')->where('sczl_gdbh',$gdbh)->count();
|
|
|
@@ -283,7 +286,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->limit($limit)->page($pages)->order('a.UniqId desc')->select();
|
|
|
$count = Db::name('db_机器检验')->where($option)->count();
|
|
|
|
|
|
@@ -329,7 +332,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->limit($limit)->page($pages)->order('a.sczl_rq asc,a.UniqId desc')->select();
|
|
|
$option['sczl_单据类型'] = '初检单';
|
|
|
$option['sys_rq'] = $gdbh;
|
|
|
@@ -373,7 +376,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->page($page,$limit)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
|
|
|
$option['sczl_gdbh'] = [ 'like', '%' . $req['gdbh'] . '%'];
|
|
|
@@ -394,7 +397,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->page($page,$limit)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
|
|
|
$option['sczl_gdbh'] = ['in', $gd];
|
|
|
@@ -449,7 +452,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->page($page,$limit)->order('a.sczl_rq asc,a.UniqId desc')->select();
|
|
|
$option['sczl_单据类型'] = '初检单';
|
|
|
$option['sczl_gdbh'] = [ 'like', '%' . $req['gdbh'] . '%'];
|
|
|
@@ -477,7 +480,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->page($page,$limit)->order('a.sczl_rq asc,a.UniqId desc')->select();
|
|
|
$option['sczl_单据类型'] = '初检单';
|
|
|
$option['sczl_gdbh'] = ['in', $gd];
|
|
|
@@ -547,7 +550,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c12','a.sczl_bh12 = c12.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->find();
|
|
|
|
|
|
$this->success('成功',$rows);
|
|
|
@@ -598,7 +601,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c8','a.sczl_bh8 = c8.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->find();
|
|
|
|
|
|
$this->success('成功',$rows);
|
|
|
@@ -635,7 +638,7 @@ class Inspect extends Api
|
|
|
->where(['g.Gd_gdbh'=>$gdbh])
|
|
|
->where(['c.Gy0_gxmc'=>$gxmcs])
|
|
|
->join(['产品_印件资料'=>'j'],'g.Gd_cpdh=j.yj_yjdh and g.成品代号=j.yj_cpdh')
|
|
|
- ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_yjno')
|
|
|
+ ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_Yjno')
|
|
|
->select();
|
|
|
|
|
|
foreach ($rows as $key=>$value){
|
|
|
@@ -676,7 +679,7 @@ class Inspect extends Api
|
|
|
->where(['g.Gd_gdbh'=>$gdbh])
|
|
|
->where(['c.Gy0_gxmc'=>$gxmcs])
|
|
|
->join(['产品_印件资料'=>'j'],'g.Gd_cpdh=j.yj_yjdh and g.成品代号=j.yj_cpdh')
|
|
|
- ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_yjno')
|
|
|
+ ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_Yjno')
|
|
|
->select();
|
|
|
|
|
|
foreach ($rows as $key=>$value){
|
|
|
@@ -1178,7 +1181,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
|
|
|
foreach ($rows as $key=>$value) {
|
|
|
@@ -1268,7 +1271,7 @@ class Inspect extends Api
|
|
|
->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->field($field)->order('a.UniqId desc')->select();
|
|
|
|
|
|
foreach ($rows as $key=>$value) {
|
|
|
@@ -1337,7 +1340,7 @@ class Inspect extends Api
|
|
|
$rows = db()->table('db_手工检验')->alias('a')
|
|
|
->field($field)
|
|
|
->where($where)
|
|
|
- ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_Yjno')
|
|
|
->join('工单_印件资料 d', 'a.sczl_gdbh = d.Yj_Gdbh', 'left')
|
|
|
->group('a.sczl_gdbh, d.yj_yjmc, a.sczl_yjgx')
|
|
|
->order('a.sczl_gdbh asc')
|