| 123456789101112131415161718192021222324252627282930 |
- <?php
- class sealaplClassModel extends Model
- {
- public function getSealaplList($whereArr) {
- $where = "1=1";
- if (isset($whereArr['startDate']) && isset($whereArr['stopDate'])) {
- $startDate = $whereArr['startDate'];
- $stopDate = $whereArr['stopDate'];
- // $where .= " and IFNULL(`office_date`, `applydt`) >= '{$startDate}' and IFNULL(`office_date`, `applydt`) <= '{$stopDate}'";
- $where .= " and DATE_FORMAT(`office_date`,'%Y-%m-%d') >= '{$startDate}' and DATE_FORMAT(`office_date`,'%Y-%m-%d') <= '{$stopDate}'";
- }
- if (isset($whereArr['status']) && $whereArr['status'] == 1) {
- $where .= " and `status` = 1";
- }
- if (isset($whereArr['export_type']) && $whereArr['export_type'] != 0) {
- $where .= " and `seal_name` = '".$whereArr['export_type']."'";
- }
- $list = m("sealapl")
- ->getall($where, "*", "year_num, substr(office_date, 1, 4) desc, id asc");
- return $list;
- }
- }
|