Sfoglia il codice sorgente

决策支持优化

qiuenguang 1 anno fa
parent
commit
c607aab9d8
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  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.设备编号')