|
|
@@ -61,9 +61,14 @@ class MonthlyGarments extends Api
|
|
|
$this->success('成功', $formattedData);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 样衣进度列表数据
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 样衣进度列表数据(支持分页)
|
|
|
+ * @param string sys_rq 年月,如 2026-09
|
|
|
+ * @param string customer 客户编号
|
|
|
+ * @param string search 搜索
|
|
|
+ * @param int page 页码,默认1
|
|
|
+ * @param int pageSize|limit 每页条数,默认30
|
|
|
+ */
|
|
|
public function getMonthlyGarmentsList()
|
|
|
{
|
|
|
if (!$this->request->isGet()) {
|
|
|
@@ -73,6 +78,13 @@ class MonthlyGarments extends Api
|
|
|
$yearMonth = $this->request->param('sys_rq', '');
|
|
|
$customerCode = $this->request->param('customer', '');
|
|
|
$search = $this->request->param('search', '');
|
|
|
+ $page = max(1, intval($this->request->param('page', 1)));
|
|
|
+ $limit = intval($this->request->param('pageSize', 0));
|
|
|
+ if ($limit <= 0) {
|
|
|
+ $limit = intval($this->request->param('limit', 30));
|
|
|
+ }
|
|
|
+ $limit = max(1, min(200, $limit));
|
|
|
+ $offset = ($page - 1) * $limit;
|
|
|
|
|
|
$query = \db('月度样衣进度')
|
|
|
->whereNull('Mod_rq');
|
|
|
@@ -97,15 +109,32 @@ class MonthlyGarments extends Api
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- $results = $query->order('UniqId DESC')->select();
|
|
|
+ $total = (int)(clone $query)->count();
|
|
|
+ $results = $query
|
|
|
+ ->order('UniqId DESC')
|
|
|
+ ->limit($offset, $limit)
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ foreach ($results as &$row) {
|
|
|
+ if (!empty($row['下单日期'])) {
|
|
|
+ $row['下单日期'] = date('Y-m-d', strtotime($row['下单日期']));
|
|
|
+ }
|
|
|
+ if (!empty($row['计划交办日期'])) {
|
|
|
+ $row['计划交办日期'] = date('Y-m-d', strtotime($row['计划交办日期']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ unset($row);
|
|
|
|
|
|
$this->success('成功', [
|
|
|
'result' => $results,
|
|
|
- 'total' => count($results)
|
|
|
+ 'total' => $total,
|
|
|
+ 'page' => $page,
|
|
|
+ 'pageSize' => $limit,
|
|
|
]);
|
|
|
}
|
|
|
- /**
|
|
|
- * 样衣进度新增数据
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 样衣进度新增数据
|
|
|
*/
|
|
|
public function saveMonthlyGarments()
|
|
|
{
|