|
|
@@ -990,14 +990,19 @@ class OrderSuperLoss extends Api
|
|
|
if (empty($params['order']) || empty($params['order'])) {
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
+ if (empty($params['yjno']) || empty($params['yjno'])) {
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
$order = $params['order'];
|
|
|
+ $yjno = $params['yjno'];
|
|
|
$sql = "SELECT a.Gy0_yjno,a.Gy0_gxh,rtrim(a.Gy0_gxmc) as Gy0_gxmc,rtrim(a.Add_gxmc) as Add_gxmc,a.Gy0_计划接货数, a.Gy0_ls,a.Gy0_sbbh,a.PD_WG,SUM(b.sczl_cl) as sczl_cl,
|
|
|
SUM(b.sczl_zcfp) as sczl_zcfp,SUM(b.sczl_来料少数) as 来料异常,COUNT(DISTINCT b.sczl_num) as process_num,b.sczl_Pgcl,SUM(c.sczl_cl) as cl,b.sczl_rq
|
|
|
FROM `工单_工艺资料` a
|
|
|
LEFT JOIN `设备_产量计酬` b ON a.Gy0_gdbh = b.sczl_gdbh AND a.Gy0_yjno = b.sczl_yjno AND a.Gy0_gxh = b.sczl_gxh
|
|
|
LEFT JOIN db_sczl c ON a.Gy0_gdbh = c.sczl_gdbh AND a.Gy0_yjno = c.sczl_yjno AND a.Gy0_gxh = c.sczl_gxh
|
|
|
- WHERE a.Gy0_gdbh = '{$order}' GROUP BY a.Gy0_yjno, a.Gy0_gxh ORDER BY a.Gy0_yjno, a.Gy0_gxh";
|
|
|
+ WHERE a.Gy0_gdbh = '{$order}' and a.GY0_Yjno = '{$yjno}' GROUP BY a.Gy0_yjno, a.Gy0_gxh ORDER BY a.Gy0_yjno, a.Gy0_gxh";
|
|
|
$data = Db::query($sql);
|
|
|
+
|
|
|
//手检数据
|
|
|
$handData =db('db_手工检验')->where('sczl_gdbh',$order)->field('sum(sczl_cl) as cl,rtrim(sczl_yjgx) as sczl_gxh')->select();
|
|
|
//包装及成品防护数据
|