|
|
@@ -466,4 +466,36 @@ class ReportingWork extends Api
|
|
|
$this->success('删除成功');
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询机台报工记录
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $date 日期
|
|
|
+ * @param string $machine 机台编号
|
|
|
+ * @return array
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ * @throws \think\exception\DbException
|
|
|
+ */
|
|
|
+ public function GetReportingWorkRecord()
|
|
|
+ {
|
|
|
+ if (!$this->request->isGet()) {
|
|
|
+ $this->error('请求方法错误');
|
|
|
+ }
|
|
|
+ $params = $this->request->param();
|
|
|
+ if (empty($params['date'])) {
|
|
|
+ $this->error('日期不能为空');
|
|
|
+ }
|
|
|
+ if (empty($params['machine'])) {
|
|
|
+ $this->error('机台编号不能为空');
|
|
|
+ }
|
|
|
+ $rows = db('设备_工分计酬')
|
|
|
+ ->where('del_rq', null)
|
|
|
+ ->where('date', 'like', $params['date'] . '%')
|
|
|
+ ->where('machine', $params['machine'])
|
|
|
+ ->field('work_order,majorprocess,part_code,process_code,process_name,staff_no,staff_name,standard_hour,standard_score,coefficient,number,production_hour,production_score,machine,sys_id,sys_rq')
|
|
|
+ ->order('process_code asc,staff_no asc')
|
|
|
+ ->select();
|
|
|
+ $this->success('成功', $rows);
|
|
|
+ }
|
|
|
}
|