소스 검색

决策支持优化

qiuenguang 1 년 전
부모
커밋
c607aab9d8
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      application/api/controller/Decision.php

+ 6 - 3
application/api/controller/Decision.php

@@ -124,7 +124,8 @@ class Decision extends Api
         if (empty($param['mouth']) || empty($param['machine']) || empty($param['team'])){
             $this->error('参数错误');
         }
-        $mouth = date('Y-m',strtotime($param['mouth']));
+        //将参数装换成标准日期格式
+        $mouth = date_create_from_format('Ym', $param['mouth'])->format('Y-m');
         $team = substr($param['team'],0,1);
         $list = \db('设备_产量计酬')
             ->alias('a')
@@ -178,7 +179,8 @@ class Decision extends Api
         if(!empty($param['sist'])){
             $where['设备编组'] = $param['sist'];
         }
-        $mouth = date('Y-m',strtotime($param['mouth']));
+        //将参数装换成标准日期格式
+        $mouth = date_create_from_format('Ym', $param['mouth'])->format('Y-m');
         $list = \db('设备_基本资料')
             ->alias('a')
             ->join('设备_产量计酬 b','a.设备编号 = b.sczl_jtbh')
@@ -234,7 +236,8 @@ class Decision extends Api
         if (empty($param['mouth']) || empty($param['machine'])){
             $this->error('参数错误');
         }
-        $mouth = date('Y-m',strtotime($param['mouth']));
+        //将参数装换成标准日期格式
+        $mouth = date_create_from_format('Ym', $param['mouth'])->format('Y-m');
         $list = \db('设备_产量计酬')
             ->alias('a')
             ->join('设备_基本资料 b','a.sczl_jtbh = b.设备编号')