|
@@ -147,6 +147,17 @@ class Course extends Api
|
|
|
$this->error('请求错误');
|
|
$this->error('请求错误');
|
|
|
}
|
|
}
|
|
|
$param = $this->request->param();
|
|
$param = $this->request->param();
|
|
|
|
|
+ $page = (int)($param['page'] ?? 1);
|
|
|
|
|
+ $limit = (int)($param['limit'] ?? 20);
|
|
|
|
|
+ if ($page < 1) {
|
|
|
|
|
+ $page = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($limit < 1) {
|
|
|
|
|
+ $limit = 20;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($limit > 200) {
|
|
|
|
|
+ $limit = 200;
|
|
|
|
|
+ }
|
|
|
$where = [];
|
|
$where = [];
|
|
|
if (!empty($param['order'])) {
|
|
if (!empty($param['order'])) {
|
|
|
$where['a.Gd_cpdh|a.成品代号'] = ['like', $param['order'] . '%'];
|
|
$where['a.Gd_cpdh|a.成品代号'] = ['like', $param['order'] . '%'];
|
|
@@ -179,11 +190,19 @@ class Course extends Api
|
|
|
$this->applyCourseRange($listQuery, 'a.接单日期', $param['接单日期起'] ?? '', $param['接单日期止'] ?? '', true);
|
|
$this->applyCourseRange($listQuery, 'a.接单日期', $param['接单日期起'] ?? '', $param['接单日期止'] ?? '', true);
|
|
|
$this->applyCourseRange($listQuery, 'a.交货日期', $param['交货日期起'] ?? '', $param['交货日期止'] ?? '', true);
|
|
$this->applyCourseRange($listQuery, 'a.交货日期', $param['交货日期起'] ?? '', $param['交货日期止'] ?? '', true);
|
|
|
$this->applyCourseRange($listQuery, 'b.yj_平张投料', $param['计划投料起'] ?? '', $param['计划投料止'] ?? '');
|
|
$this->applyCourseRange($listQuery, 'b.yj_平张投料', $param['计划投料起'] ?? '', $param['计划投料止'] ?? '');
|
|
|
|
|
+ $total = (clone $listQuery)->group('b.Yj_Gdbh,b.yj_Yjno')->count();
|
|
|
$list = $listQuery
|
|
$list = $listQuery
|
|
|
->group('b.Yj_Gdbh,b.yj_Yjno')
|
|
->group('b.Yj_Gdbh,b.yj_Yjno')
|
|
|
|
|
+ ->order('b.Yj_Gdbh asc, b.yj_Yjno asc')
|
|
|
|
|
+ ->limit(($page - 1) * $limit, $limit)
|
|
|
->select();
|
|
->select();
|
|
|
if (empty($list)) {
|
|
if (empty($list)) {
|
|
|
- $this->success('');
|
|
|
|
|
|
|
+ $this->success('成功', [
|
|
|
|
|
+ 'total' => (int)$total,
|
|
|
|
|
+ 'page' => $page,
|
|
|
|
|
+ 'limit' => $limit,
|
|
|
|
|
+ 'list' => [],
|
|
|
|
|
+ ]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$orderNos = [];
|
|
$orderNos = [];
|
|
@@ -242,7 +261,12 @@ class Course extends Api
|
|
|
}
|
|
}
|
|
|
unset($list[$key]['yj_Yjno']);
|
|
unset($list[$key]['yj_Yjno']);
|
|
|
}
|
|
}
|
|
|
- $this->success('成功', $list);
|
|
|
|
|
|
|
+ $this->success('成功', [
|
|
|
|
|
+ 'total' => (int)$total,
|
|
|
|
|
+ 'page' => $page,
|
|
|
|
|
+ 'limit' => $limit,
|
|
|
|
|
+ 'list' => $list,
|
|
|
|
|
+ ]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|