qiuenguang пре 1 година
родитељ
комит
d34c912b03
1 измењених фајлова са 27 додато и 0 уклоњено
  1. 27 0
      application/api/controller/WorkOrder.php

+ 27 - 0
application/api/controller/WorkOrder.php

@@ -1175,4 +1175,31 @@ class WorkOrder extends Api
         }
         return $list;
     }
+
+    /**
+     * 获取小时产能
+     * @ApiMethod  (GET)
+     * @param  void
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+
+    public function capacityList()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (empty($param)){
+            $this->error('参数错误');
+        }
+        $machine = explode(' ',$param['machine'])[0];
+        $number = \db('设备_基本资料')->where('设备编号',$machine)->field('rtrim(排单小时定额) as 小时产能')->find();
+        if (empty($number)){
+            $this->error('未找到小时产能');
+        }
+        $this->success('成功',$number['小时产能']);
+    }
 }