|
@@ -33,12 +33,30 @@ class flow_sealaplClassModel extends flowModel
|
|
|
//单据判断条件从写$lx类型,$uid用户Id
|
|
|
protected function flowbillwhere($lx, $uid){
|
|
|
$where = '';
|
|
|
+// $this->rock->post('key');
|
|
|
+
|
|
|
+ $startDate = $this->rock->post("start_date");
|
|
|
+ $stopDate = $this->rock->post("stop_date");
|
|
|
+ $status = $this->rock->post("status");
|
|
|
+ $export_type = $this->rock->post("export_type");
|
|
|
+
|
|
|
if ($uid == 'all') {
|
|
|
- $where = 'and '.$this->adminid.' in (1, 28)';
|
|
|
+ $where .= 'and '.$this->adminid.' in (1, 28)';
|
|
|
+ }
|
|
|
+ // 开始时间
|
|
|
+ if (!empty($startDate)) {
|
|
|
+ $where .= " and office_date > '{$startDate}'";
|
|
|
}
|
|
|
+ // 结束时间
|
|
|
+ if (!empty($stopDate)) {
|
|
|
+ $where .= " and office_date < '{$stopDate}'";
|
|
|
+ }
|
|
|
+ // 审核完成
|
|
|
+ $where .= " and status = '{$status}'";
|
|
|
+
|
|
|
return [
|
|
|
'where' => $where,
|
|
|
- 'order'=>'id desc'
|
|
|
+ 'order'=>'status, office_date desc, id desc'
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -178,25 +196,26 @@ class flow_sealaplClassModel extends flowModel
|
|
|
$rs['state_info'] = $this->getApproval($rs['nowcheckname'] ?? ''); // 当前审核人
|
|
|
|
|
|
// 详情编号展示
|
|
|
- $date = $rs['date'] ?? null;
|
|
|
- if ($rs['date'] == '1970-01-01') $rs['date'] = '';
|
|
|
-
|
|
|
- if ($date) {
|
|
|
- $year = date("Y", strtotime($date));
|
|
|
- $month = date("m", strtotime($date));
|
|
|
- $this_month = date("Y-m", strtotime($date));
|
|
|
- $last_month = date("Y-m", strtotime("-1 month", strtotime($date)));
|
|
|
-
|
|
|
- $this_month_max_id = $this->getone("DATE_FORMAT(applydt,'%Y-%m') = '{$this_month}'", "max(id) as id")['id'];
|
|
|
- $last_month_max_id = $this->getone("DATE_FORMAT(applydt,'%Y-%m') = '{$last_month}'", "max(id) as id")['id'];
|
|
|
- $this_month_max_id = empty($last_month_max_id) ? 2 : $this_month_max_id;
|
|
|
-
|
|
|
- $rs['year'] = $year;
|
|
|
- $rs['month'] = $month;
|
|
|
- $rs['num'] = ($rs['id'] - (empty($last_month_max_id) ? $this_month_max_id - 2: $last_month_max_id));
|
|
|
-// $rs['num'] = $this_month_max_id . '-' . $last_month_max_id . '-' . $this_month_max_id;
|
|
|
+ if ($rs['date'] == '1970-01-01') {
|
|
|
+ $rs['date'] = "";
|
|
|
+ $date = $rs['applydt'];
|
|
|
+ } else {
|
|
|
+ $date = $rs['date'];
|
|
|
}
|
|
|
-// $rs['num'] = $rs['date'];
|
|
|
+
|
|
|
+ $year = date("Y", strtotime($date));
|
|
|
+ $month = date("m", strtotime($date));
|
|
|
+ $this_month = date("Y-m", strtotime($date));
|
|
|
+ $last_month = date("Y-m", strtotime("-1 month", strtotime($date)));
|
|
|
+
|
|
|
+ $this_month_max_id = $this->getone("DATE_FORMAT(applydt,'%Y-%m') = '{$this_month}'", "max(id) as id")['id'];
|
|
|
+ $last_month_max_id = $this->getone("DATE_FORMAT(applydt,'%Y-%m') = '{$last_month}'", "max(id) as id")['id'];
|
|
|
+ $this_month_max_id = empty($last_month_max_id) ? 2 : $this_month_max_id;
|
|
|
+
|
|
|
+ $rs['year'] = $year;
|
|
|
+ $rs['month'] = $month;
|
|
|
+ $rs['num'] = ($rs['id'] - (empty($last_month_max_id) ? $this_month_max_id - 2: $last_month_max_id));
|
|
|
+
|
|
|
|
|
|
return $rs;
|
|
|
}
|
|
@@ -256,11 +275,11 @@ class flow_sealaplClassModel extends flowModel
|
|
|
];
|
|
|
|
|
|
} else if ($step_name == '办公室审批') {
|
|
|
- $date = date('Y-m-d'); // 办公室处理日期
|
|
|
+ $date = date('Y-m-d H:i:s'); // 办公室处理日期
|
|
|
// 获取当月最大id数据
|
|
|
$yearMon = date("Y-m", strtotime($date));
|
|
|
|
|
|
- $maxInfo = $this->getone("DATE_FORMAT(applydt,'%Y-%m') = '{$yearMon}' and status = 1", "max(year_num) as id");
|
|
|
+ $maxInfo = $this->getone("DATE_FORMAT(office_date,'%Y-%m') = '{$yearMon}' and status = 1 and seal_name = {$this->rs['seal_name']}", "max(year_num) as id");
|
|
|
$max_year_num = 1;
|
|
|
if (isset($maxInfo['id'])) {
|
|
|
$max_year_num = $maxInfo['id'] + 1;
|