|
@@ -78,8 +78,6 @@ class Decision extends Api
|
|
|
->distinct(true)
|
|
->distinct(true)
|
|
|
->field('DATE_FORMAT(sczl_rq,"%Y-%m-%d") as day')
|
|
->field('DATE_FORMAT(sczl_rq,"%Y-%m-%d") as day')
|
|
|
->whereRaw("DATE_FORMAT(sczl_rq, '%Y-%m') = '$mouth'")
|
|
->whereRaw("DATE_FORMAT(sczl_rq, '%Y-%m') = '$mouth'")
|
|
|
-// ->whereTime('sczl_rq',$mouth)
|
|
|
|
|
-// ->group('day')
|
|
|
|
|
->order('day')
|
|
->order('day')
|
|
|
->select();
|
|
->select();
|
|
|
$day = array_reduce($day, function($carry, $item) {
|
|
$day = array_reduce($day, function($carry, $item) {
|
|
@@ -95,15 +93,6 @@ class Decision extends Api
|
|
|
->group('sczl_bzdh')
|
|
->group('sczl_bzdh')
|
|
|
->select();
|
|
->select();
|
|
|
foreach ($data['total'][$key] as $k=>$v){
|
|
foreach ($data['total'][$key] as $k=>$v){
|
|
|
-// $day_total = db('设备_产量计酬')
|
|
|
|
|
-// ->field('DATE(sczl_rq) as day, SUM(sczl_cl) as total_cl')
|
|
|
|
|
-// ->where('sczl_rq','like',$mouth.'%')
|
|
|
|
|
-// ->where('sczl_jtbh', $value['设备编号'])
|
|
|
|
|
-// ->where('sczl_bzdh', $v['sczl_bzdh'])
|
|
|
|
|
-// ->group('sczl_bzdh,day')
|
|
|
|
|
-// ->select();
|
|
|
|
|
-// $day_total = array_column($day_total, 'total_cl', 'day');
|
|
|
|
|
-// $data['total'][$key][$k]['day_total'] = $day_total;
|
|
|
|
|
$day_cl = \db('设备_产量计酬')
|
|
$day_cl = \db('设备_产量计酬')
|
|
|
->alias('a')
|
|
->alias('a')
|
|
|
->join('工单_印件资料 c','a.sczl_gdbh = c.Yj_Gdbh AND a.sczl_yjno = c.yj_Yjno')
|
|
->join('工单_印件资料 c','a.sczl_gdbh = c.Yj_Gdbh AND a.sczl_yjno = c.yj_Yjno')
|
|
@@ -135,6 +124,7 @@ class Decision extends Api
|
|
|
$day_total[$item['day']] =$day_cl[$index]['total_cl'];
|
|
$day_total[$item['day']] =$day_cl[$index]['total_cl'];
|
|
|
}
|
|
}
|
|
|
$data['total'][$key][$k]['day_total'] = $day_total;
|
|
$data['total'][$key][$k]['day_total'] = $day_total;
|
|
|
|
|
+ $data['total'][$key][$k]['total_cl'] = array_sum($day_total);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
$this->success('成功',$data);
|
|
$this->success('成功',$data);
|